@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines (2 loc) • 2.21 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("kendo.core.js")):"function"==typeof define&&define.amd?define(["exports","kendo.core.min"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Appbar={}))}(this,(function(e){var t=()=>"<span class='k-appbar-spacer'></span>";!function(e){var i=window.kendo,o=i.ui,n=o.Widget,s="resize",a=n.extend({init:function(t,i){var o=this;n.fn.init.call(o,t,i),o.element=e(t).addClass("k-appbar"),"none"!=o.options.position&&o.element.addClass("k-appbar-"+o.options.position),o.element.addClass("k-appbar-"+o.options.positionMode+" k-appbar-"+o.options.themeColor).attr("role","toolbar"),o._initItems(),o._attachEvents()},events:[s],options:{name:"AppBar",positionMode:"static",position:"none",themeColor:"light",items:[]},destroy:function(){this.resizeHandler&&(i.unbindResize(this.resizeHandler),this.resizeHandler=null),n.fn.destroy.call(this)},setOptions:function(e){var t=this;"none"!=t.options.position&&t.element.removeClass("k-appbar-"+t.options.position),t.element.removeClass("k-appbar-"+t.options.positionMode+" k-appbar-"+t.options.themeColor),i.deepExtend(t.options,e),this.destroy(),this.element.empty(),this.init(this.element,this.options)},_initItems:function(){for(var o,n,s=this.options.items,a="",p=0;p<s.length;p++)if("spacer"==(o=s[p]).type)n=e(i.template(t)({})).addClass(o.className),o.width&&(n.addClass("k-appbar-spacer-sized"),n.css("width","string"==typeof o.width?o.width:o.width+"px")),a+=n[0].outerHTML;else{if(!o.template)throw new Error("Having a template for the contentItem is mandatory");o.className?a+="<div class='k-appbar-section "+o.className+"'>":a+="<div class='k-appbar-section'>",a+=i.template(o.template)({}),a+="</div>"}this.element.html(a)},_resize:function(){this.trigger(s)},_attachEvents:function(){var e=this;e.resizeHandler=e._resize.bind(e),i.onResize(e.resizeHandler)}});o.plugin(a)}(window.kendo.jQuery);var i=kendo;e.__meta__={id:"appbar",name:"AppBar",category:"web",depends:["core"]},e.default=i,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=kendo.appbar.min.js.map