vendor/assets/javascripts/kendo/kendo.columnmenu.min.js in kendoui-rails-0.0.8 vs vendor/assets/javascripts/kendo/kendo.columnmenu.min.js in kendoui-rails-0.0.9
- old
+ new
@@ -1,10 +1,11 @@
/*
-* Kendo UI Web v2012.2.710 (http://kendoui.com)
+* Kendo UI Web v2012.3.1114 (http://kendoui.com)
* Copyright 2012 Telerik AD. All rights reserved.
*
-* Kendo UI Web commercial licenses may be obtained at http://kendoui.com/web-license
+* 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
*/
-;(function(a,b){function s(a){String.prototype.trim?a=a.trim():a=a.replace(/^\s\s*/,"").replace(/\s\s*$/,"");return a.replace(/ /gi,"")}var c=window.kendo,d=c.ui,e=a.proxy,f=a.extend,g=a.grep,h=a.map,i=a.inArray,j="k-state-selected",k="asc",l="desc",m="click",n="change",o="kendoPopup",p="kendoFilterMenu",q="kendoMenu",r=d.Widget,t=r.extend({init:function(b,d){var f=this,g;r.fn.init.call(f,b,d),b=f.element,d=f.options,f.owner=d.owner,f.field=b.attr(c.attr("field")),g=b.find(".k-header-column-menu"),g[0]||(g=b.prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),f._clickHandler=e(f._click,f),g.click(f._clickHandler),f.link=g,f.wrapper=a('<div class="k-column-menu"/>'),f.wrapper.html(c.template(u)({ns:c.ns,messages:d.messages,sortable:d.sortable,filterable:d.filterable,columns:f._ownerColumns(),showColumns:d.columns})),f.popup=f.wrapper[o]({anchor:g,open:e(f._open,f)}).data(o),f._menu(),f._sort(),f._columns(),f._filter()},options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns"},columns:!0,sortable:!0,filterable:!0},destroy:function(){var a=this;a.filterMenu&&(a.filterMenu.destroy(),a.filterMenu=null),a.wrapper.children().removeData(q),a.wrapper.removeData(o).remove(),a.link.unbind(m,a._clickHandler),a.element.removeData("kendoColumnMenu"),a.columns=null},close:function(){this.menu.close(),this.popup.close()},_click:function(a){a.preventDefault(),a.stopPropagation(),this.popup.toggle()},_open:function(){a(".k-column-menu").not(this.wrapper).each(function(){a(this).data(o).close()})},_ownerColumns:function(){var a=this.owner.columns,b=g(a,function(a){var b=!0,c=s(a.title||"");if(a.menu===!1||!a.field&&!c.length)b=!1;return b});return h(b,function(b){return{field:b.field,title:b.title||b.field,hidden:b.hidden,index:i(b,a)}})},_menu:function(){this.menu=this.wrapper.children()[q]({orientation:"vertical",closeOnClick:!1}).data(q)},_sort:function(){var b=this;b.options.sortable&&(b.refresh(),b.options.dataSource.bind(n,e(b.refresh,b)),b.menu.element.delegate(".k-sort-asc, .k-sort-desc",m,function(){var c=a(this),d=c.hasClass("k-sort-asc")?k:l;c.parent().find(".k-sort-"+(d==k?l:k)).removeClass(j),b._sortDataSource(c,d),b.close()}))},_sortDataSource:function(a,c){var d=this,e=d.options.sortable,f=d.options.dataSource,g,h,i=f.sort()||[];a.hasClass(j)&&e&&e.allowUnsort!==!1?(a.removeClass(j),c=b):a.addClass(j);if(e===!0||e.mode==="single")i=[{field:d.field,dir:c}];else{for(g=0,h=i.length;g<h;g++)if(i[g].field===d.field){i.splice(g,1);break}i.push({field:d.field,dir:c})}f.sort(i)},_columns:function(){var b=this;b.options.columns&&(b._updateColumnsMenu(),b.owner.bind(["columnHide","columnShow"],function(){b._updateColumnsMenu()}),b.wrapper.delegate("[type=checkbox]",n,function(d){var e=a(this),f=parseInt(e.attr(c.attr("index")),10);e.is(":checked")?b.owner.showColumn(f):b.owner.hideColumn(f)}))},_updateColumnsMenu:function(){var a=this._ownerColumns(),b=h(a,function(a){return"["+c.attr("index")+"="+a.index+"]"}).join(","),d=g(a,function(a){return!a.hidden}),e=h(d,function(a){return"["+c.attr("index")+"="+a.index+"]"}).join(",");this.wrapper.find(b).attr("checked",!1),this.wrapper.find(e).attr("checked",!0).attr("disabled",d.length==1)},_filter:function(){var a=this,b=a.options;b.filterable!==!1&&(a.filterMenu=a.wrapper.find(".k-filterable")[p](f(!0,{},{appendToElement:!0,dataSource:b.dataSource,values:b.values,field:a.field},b.filterable)).data(p))},refresh:function(){var a=this,b=a.options.dataSource.sort()||[],c,d=a.field,e,f;a.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(j);for(e=0,f=b.length;e<f;e++)c=b[e],d==c.field&&a.wrapper.find(".k-sort-"+c.dir).addClass(j)}}),u='<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><label><input type="checkbox" data-#=ns#field="#=columns[col].field#" data-#=ns#index="#=columns[col].index#"/>#=columns[col].title#</label></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>';d.plugin(t)})(jQuery);
+(function(e,n){function s(n){return e.trim(n).replace(/ /gi,"")}var t=window.kendo,l=t.ui,i=e.proxy,o=e.extend,r=e.grep,a=e.map,u=e.inArray,c="k-state-selected",d="asc",f="desc",p="change",m="kendoPopup",k="kendoFilterMenu",h="kendoMenu",w=".kendoColumnMenu",b=/(\[|\]|\$|\.|\:|\+)/g,C=l.Widget,_=C.extend({init:function(n,s){var l,o=this;C.fn.init.call(o,n,s),n=o.element,s=o.options,o.owner=s.owner,o.dataSource=s.dataSource,o.field=n.attr(t.attr("field")),l=n.find(".k-header-column-menu"),l[0]||(l=n.prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),o.link=l.attr("tabindex",-1).on("click"+w,i(o._click,o)),o.wrapper=e('<div class="k-column-menu"/>'),o.wrapper.html(t.template(v)({ns:t.ns,messages:s.messages,sortable:s.sortable,filterable:s.filterable,columns:o._ownerColumns(),showColumns:s.columns})),o.popup=o.wrapper[m]({anchor:l,open:i(o._open,o),activate:i(o._activate,o),close:o.options.closeCallback}).data(m),o._menu(),o._sort(),o._columns(),o._filter()},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;C.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.element.off(w),e.menu.destroy(),e.wrapper.off(w),e.popup.destroy(),e.link.off(w)},close:function(){this.menu.close(),this.popup.close(),this.popup.element.off("keydown"+w)},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup.toggle()},_open:function(){var n=this;e(".k-column-menu").not(n.wrapper).each(function(){e(this).data(m).close()}),n.popup.element.on("keydown"+w,function(e){e.keyCode==t.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,t=s(e.title||"");return(e.menu===!1||!e.field&&!t.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()[h]({orientation:"vertical",closeOnClick:!1}).data(h)},_sort:function(){var n=this;n.options.sortable&&(n.refresh(),n._refreshHandler=i(n.refresh,n),n.dataSource.bind(p,n._refreshHandler),n.menu.element.on("click"+w,".k-sort-asc, .k-sort-desc",function(){var s=e(this),t=s.hasClass("k-sort-asc")?d:f;s.parent().find(".k-sort-"+(t==d?f:d)).removeClass(c),n._sortDataSource(s,t),n.close()}))},_sortDataSource:function(e,s){var t,l,i=this,o=i.options.sortable,r=i.dataSource,a=r.sort()||[];if(e.hasClass(c)&&o&&o.allowUnsort!==!1?(e.removeClass(c),s=n):e.addClass(c),o===!0||"single"===o.mode)a=[{field:i.field,dir:s}];else{for(t=0,l=a.length;l>t;t++)if(a[t].field===i.field){a.splice(t,1);break}a.push({field:i.field,dir:s})}r.sort(a)},_columns:function(){var n=this;n.options.columns&&(n._updateColumnsMenu(),n._updateColumnsMenuHandler=i(n._updateColumnsMenu,n),n.owner.bind(["columnHide","columnShow"],n._updateColumnsMenuHandler),n.menu.bind("select",function(s){var l,i,o,a,c=e(s.item),d=n.owner.columns;c.parent().closest("li.k-columns-item")[0]&&(l=c.find(":checkbox"),l.attr("disabled")||(a=l.attr(t.attr("field")),o=r(d,function(e){return e.field==a||e.title==a})[0],i=u(o,d),o.hidden===!0?n.owner.showColumn(i):n.owner.hideColumn(i)))}))},_updateColumnsMenu:function(){var e="["+t.attr("field")+"=",n=this._ownerColumns(),s=a(n,function(n){return e+n.field.replace(b,"\\$1")+"]"}).join(","),l=r(n,function(e){return!e.hidden}),i=a(l,function(n){return e+n.field.replace(b,"\\$1")+"]"}).join(",");this.wrapper.find(s).attr("checked",!1),this.wrapper.find(i).attr("checked",!0).attr("disabled",1==l.length)},_filter:function(){var e=this,n=e.options;n.filterable!==!1&&(e.filterMenu=e.wrapper.find(".k-filterable")[k](o(!0,{},{appendToElement:!0,dataSource:n.dataSource,values:n.values,field:e.field},n.filterable)).data(k))},refresh:function(){var e,n,s,t=this,l=t.options.dataSource.sort()||[],i=t.field;for(t.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(c),n=0,s=l.length;s>n;n++)e=l[n],i==e.field&&t.wrapper.find(".k-sort-"+e.dir).addClass(c)}}),v='<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>';l.plugin(_)})(window.kendo.jQuery);
\ No newline at end of file