vendor/assets/javascripts/kendo/kendo.columnmenu.min.js in kendoui-rails-0.1.0 vs vendor/assets/javascripts/kendo/kendo.columnmenu.min.js in kendoui-rails-0.1.1
- old
+ new
@@ -1,11 +1,9 @@
/*
-* Kendo UI Web v2013.1.319 (http://kendoui.com)
+* Kendo UI Beta v2013.2.716 (http://kendoui.com)
* Copyright 2013 Telerik AD. All rights reserved.
*
-* Kendo UI Web commercial licenses may be obtained at
-* https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx
-* If you do not own a commercial license, this file shall be governed by the
-* GNU General Public License (GPL) version 3.
-* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
+* Kendo UI Beta license terms available at
+* http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx
*/
-("function"==typeof define&&define.amd?define:function(e,n){return n()})(["./kendo.popup.min","./kendo.filtermenu.min","./kendo.menu.min"],function(){(function(e,n){function s(n){return e.trim(n).replace(/ /gi,"")}var i=window.kendo,t=i.ui,o=e.proxy,l=e.extend,r=e.grep,a=e.map,u=e.inArray,c="k-state-selected",d="asc",p="desc",f="change",m="init",k="kendoPopup",h="kendoFilterMenu",w="kendoMenu",b=".kendoColumnMenu",_=/(\[|\]|\$|\.|\:|\+)/g,v=t.Widget,C=v.extend({init:function(n,s){var t,l=this;v.fn.init.call(l,n,s),n=l.element,s=l.options,l.owner=s.owner,l.dataSource=s.dataSource,l.field=n.attr(i.attr("field")),t=n.find(".k-header-column-menu"),t[0]||(t=n.prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),l.link=t.attr("tabindex",-1).on("click"+b,o(l._click,l)),l.wrapper=e('<div class="k-column-menu"/>')},_init:function(){var e=this,n=e.options;e.wrapper.html(i.template(g)({ns:i.ns,messages:n.messages,sortable:n.sortable,filterable:n.filterable,columns:e._ownerColumns(),showColumns:n.columns})),e.popup=e.wrapper[k]({anchor:e.link,open:o(e._open,e),activate:o(e._activate,e),close:e.options.closeCallback}).data(k),e._menu(),e._sort(),e._columns(),e._filter(),e.trigger(m,{field:e.field,container:e.wrapper})},events:[m],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns"},columns:!0,sortable:!0,filterable:!0},destroy:function(){var e=this;v.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e.dataSource.unbind("refresh",e._refreshHandler),e.options.columns&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e.menu&&(e.menu.element.off(b),e.menu.destroy()),e.wrapper.off(b),e.popup&&e.popup.destroy(),e.link.off(b)},close:function(){this.menu.close(),this.popup.close(),this.popup.element.off("keydown"+b)},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this._init(),this.popup.toggle()},_open:function(){var n=this;e(".k-column-menu").not(n.wrapper).each(function(){e(this).data(k).close()}),n.popup.element.on("keydown"+b,function(e){e.keyCode==i.keys.ESC&&n.close()})},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=this.owner.columns,n=r(e,function(e){var n=!0,i=s(e.title||"");return(e.menu===!1||!e.field&&!i.length)&&(n=!1),n});return a(n,function(n){return{field:n.field||n.title,title:n.title||n.field,hidden:n.hidden,index:u(n,e)}})},_menu:function(){this.menu=this.wrapper.children()[w]({orientation:"vertical",closeOnClick:!1}).data(w)},_sort:function(){var n=this;n.options.sortable&&(n.refresh(),n._refreshHandler=o(n.refresh,n),n.dataSource.bind(f,n._refreshHandler),n.menu.bind("select",function(s){var i,t=e(s.item);t.hasClass("k-sort-asc")?i=d:t.hasClass("k-sort-desc")&&(i=p),i&&(t.parent().find(".k-sort-"+(i==d?p:d)).removeClass(c),n._sortDataSource(t,i),n.close())}))},_sortDataSource:function(e,s){var i,t,o=this,l=o.options.sortable,r=o.dataSource,a=r.sort()||[];if(e.hasClass(c)&&l&&l.allowUnsort!==!1?(e.removeClass(c),s=n):e.addClass(c),l===!0||"single"===l.mode)a=[{field:o.field,dir:s}];else{for(i=0,t=a.length;t>i;i++)if(a[i].field===o.field){a.splice(i,1);break}a.push({field:o.field,dir:s})}r.sort(a)},_columns:function(){var n=this;n.options.columns&&(n._updateColumnsMenu(),n._updateColumnsMenuHandler=o(n._updateColumnsMenu,n),n.owner.bind(["columnHide","columnShow"],n._updateColumnsMenuHandler),n.menu.bind("select",function(s){var t,o,l,a,c=e(s.item),d=n.owner.columns;c.parent().closest("li.k-columns-item")[0]&&(t=c.find(":checkbox"),t.attr("disabled")||(a=t.attr(i.attr("field")),l=r(d,function(e){return e.field==a||e.title==a})[0],o=u(l,d),l.hidden===!0?n.owner.showColumn(o):n.owner.hideColumn(o)))}))},_updateColumnsMenu:function(){var e="["+i.attr("field")+"=",n=this._ownerColumns(),s=a(n,function(n){return e+'"'+n.field.replace(_,"\\$1")+'"]'}).join(","),t=r(n,function(e){return!e.hidden}),o=a(t,function(n){return e+'"'+n.field.replace(_,"\\$1")+'"]'}).join(",");this.wrapper.find(s).prop("checked",!1),this.wrapper.find(o).prop("checked",!0).prop("disabled",1==t.length)},_filter:function(){var e=this,n=e.options;n.filterable!==!1&&(e.filterMenu=e.wrapper.find(".k-filterable")[h](l(!0,{},{appendToElement:!0,dataSource:n.dataSource,values:n.values,field:e.field},n.filterable)).data(h))},refresh:function(){var e,n,s,i=this,t=i.options.dataSource.sort()||[],o=i.field;for(i.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(c),n=0,s=t.length;s>n;n++)e=t[n],o==e.field&&i.wrapper.find(".k-sort-"+e.dir).addClass(c)}}),g='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var col in columns) {#<li><input type="checkbox" data-#=ns#field="#=columns[col].field#" data-#=ns#index="#=columns[col].index#"/>#=columns[col].title#</li>#}#</ul></li>#if(filterable){#<li class="k-separator"></li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#}#</ul>';t.plugin(C)})(window.kendo.jQuery)});
+
+("function"==typeof define&&define.amd?define:function(e,n){return n()})(["./kendo.popup.min","./kendo.filtermenu.min","./kendo.menu.min"],function(){!function(e,n){function i(n){return e.trim(n).replace(/ /gi,"")}var s=window.kendo,t=s.ui,o=e.proxy,l=e.extend,r=e.grep,a=e.map,u=e.inArray,c="k-state-selected",d="asc",p="desc",f="change",m="init",k="kendoPopup",h="kendoFilterMenu",w="kendoMenu",_=".kendoColumnMenu",b=/(\[|\]|\$|\.|\:|\+)/g,g=t.Widget,v=g.extend({init:function(n,i){var t,l=this;g.fn.init.call(l,n,i),n=l.element,i=l.options,l.owner=i.owner,l.dataSource=i.dataSource,l.field=n.attr(s.attr("field")),t=n.find(".k-header-column-menu"),t[0]||(t=n.prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),l.link=t.attr("tabindex",-1).on("click"+_,o(l._click,l)),l.wrapper=e('<div class="k-column-menu"/>')},_init:function(){var e=this,n=e.options;e.wrapper.html(s.template(C)({ns:s.ns,messages:n.messages,sortable:n.sortable,filterable:n.filterable,columns:e._ownerColumns(),showColumns:n.columns})),e.popup=e.wrapper[k]({anchor:e.link,open:o(e._open,e),activate:o(e._activate,e),close:e.options.closeCallback}).data(k),e._menu(),e._sort(),e._columns(),e._filter(),e.trigger(m,{field:e.field,container:e.wrapper})},events:[m],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns"},columns:!0,sortable:!0,filterable:!0},destroy:function(){var e=this;g.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e._refreshHandler&&e.dataSource.unbind(f,e._refreshHandler),e.options.columns&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e.menu&&(e.menu.element.off(_),e.menu.destroy()),e.wrapper.off(_),e.popup&&e.popup.destroy(),e.link.off(_)},close:function(){this.menu.close(),this.popup.close(),this.popup.element.off("keydown"+_)},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this._init(),this.popup.toggle()},_open:function(){var n=this;e(".k-column-menu").not(n.wrapper).each(function(){e(this).data(k).close()}),n.popup.element.on("keydown"+_,function(e){e.keyCode==s.keys.ESC&&n.close()})},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=this.owner.columns,n=r(e,function(e){var n=!0,s=i(e.title||"");return(e.menu===!1||!e.field&&!s.length)&&(n=!1),n});return a(n,function(n){return{originalField:n.field,field:n.field||n.title,title:n.title||n.field,hidden:n.hidden,index:u(n,e)}})},_menu:function(){this.menu=this.wrapper.children()[w]({orientation:"vertical",closeOnClick:!1}).data(w)},_sort:function(){var n=this;n.options.sortable&&(n.refresh(),n._refreshHandler=o(n.refresh,n),n.dataSource.bind(f,n._refreshHandler),n.menu.bind("select",function(i){var s,t=e(i.item);t.hasClass("k-sort-asc")?s=d:t.hasClass("k-sort-desc")&&(s=p),s&&(t.parent().find(".k-sort-"+(s==d?p:d)).removeClass(c),n._sortDataSource(t,s),n.close())}))},_sortDataSource:function(e,i){var s,t,o=this,l=o.options.sortable,r=o.dataSource,a=r.sort()||[];if(e.hasClass(c)&&l&&l.allowUnsort!==!1?(e.removeClass(c),i=n):e.addClass(c),l===!0||"single"===l.mode)a=[{field:o.field,dir:i}];else{for(s=0,t=a.length;t>s;s++)if(a[s].field===o.field){a.splice(s,1);break}a.push({field:o.field,dir:i})}r.sort(a)},_columns:function(){var n=this;n.options.columns&&(n._updateColumnsMenu(),n._updateColumnsMenuHandler=o(n._updateColumnsMenu,n),n.owner.bind(["columnHide","columnShow"],n._updateColumnsMenuHandler),n.menu.bind("select",function(i){var t,o,l,a,c=e(i.item),d=n.owner.columns;c.parent().closest("li.k-columns-item")[0]&&(t=c.find(":checkbox"),t.attr("disabled")||(a=t.attr(s.attr("field")),l=r(d,function(e){return e.field==a||e.title==a})[0],o=u(l,d),l.hidden===!0?n.owner.showColumn(o):n.owner.hideColumn(o)))}))},_updateColumnsMenu:function(){var e="["+s.attr("field")+"=",n=this._ownerColumns(),i=a(n,function(n){return e+'"'+n.field.replace(b,"\\$1")+'"]'}).join(","),t=r(n,function(e){return!e.hidden}),o=r(t,function(e){return e.originalField}).length,l=a(t,function(n){return e+'"'+n.field.replace(b,"\\$1")+'"]'}).join(",");this.wrapper.find(i).prop("checked",!1),this.wrapper.find(l).prop("checked",!0).prop("disabled",1==o)},_filter:function(){var e=this,n=e.options;n.filterable!==!1&&(e.filterMenu=e.wrapper.find(".k-filterable")[h](l(!0,{},{appendToElement:!0,dataSource:n.dataSource,values:n.values,field:e.field},n.filterable)).data(h))},refresh:function(){var e,n,i,s=this,t=s.options.dataSource.sort()||[],o=s.field;for(s.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(c),n=0,i=t.length;i>n;n++)e=t[n],o==e.field&&s.wrapper.find(".k-sort-"+e.dir).addClass(c)}}),C='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var col in columns) {#<li><input type="checkbox" data-#=ns#field="#=columns[col].field#" data-#=ns#index="#=columns[col].index#"/>#=columns[col].title#</li>#}#</ul></li>#if(filterable){#<li class="k-separator"></li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#}#</ul>';t.plugin(v)}(window.kendo.jQuery)});
\ No newline at end of file