vendor/assets/javascripts/kendo/kendo.listview.min.js in kendoui-rails-0.0.8 vs vendor/assets/javascripts/kendo/kendo.listview.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){var c=window.kendo,d="change",e="dataBound",f="dataBinding",g=c.ui.Widget,h=c.keys,i=">*",j="requestStart",k="error",l="k-state-focused",m="k-focusable",n="k-state-selected",o="k-edit-item",p="string",q="edit",r="remove",s="save",t="click",u=a.proxy,v=c.ui.progress,w=c.data.DataSource,x=g.extend({init:function(b,d){var e=this;d=a.isArray(d)?{dataSource:d}:d,g.fn.init.call(e,b,d),d=e.options,e.wrapper=e.element,e._element(),e._dataSource(),e.template=c.template(d.template||""),e.altTemplate=c.template(d.altTemplate||d.template),e.editTemplate=c.template(d.editTemplate||""),e._navigatable(),e._selectable(),e._pageable(),e._crudHandlers(),e.options.autoBind&&e.dataSource.fetch(),c.notify(e)},events:[d,f,e,q,r,s],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},items:function(){return this.element.find(i)},setDataSource:function(a){this.options.dataSource=a,this._dataSource(),this.options.autoBind&&a.fetch()},_dataSource:function(){var a=this;a.dataSource&&a._refreshHandler?a.dataSource.unbind(d,a._refreshHandler).unbind(j,a._requestStartHandler).unbind(k,a._errorHandler):(a._refreshHandler=u(a.refresh,a),a._requestStartHandler=u(a._requestStart,a),a._errorHandler=u(a._error,a)),a.dataSource=w.create(a.options.dataSource).bind(d,a._refreshHandler).bind(j,a._requestStartHandler).bind(k,a._errorHandler)},_requestStart:function(){v(this.element,!0)},_error:function(){v(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview")},refresh:function(b){var d=this,g=d.dataSource.view(),h,i,j,k="",l,m,n=d.template,o=d.altTemplate;if(b&&b.action==="itemchange")d.editable||(h=b.items[0],l=g.indexOf(h),l>=0&&(j=a(n(h)),d.items().eq(l).replaceWith(j),d.trigger("itemChange",{item:j,data:h})));else{d.trigger(f),d._destroyEditable();for(l=0,m=g.length;l<m;l++)l%2?k+=o(g[l]):k+=n(g[l]);d.element.html(k),i=d.items();for(l=0,m=g.length;l<m;l++)i.eq(l).attr(c.attr("uid"),g[l].uid);d.trigger(e)}},_pageable:function(){var b=this,c=b.options.pageable,d,e;a.isPlainObject(c)&&(e=c.pagerId,d=a.extend({},c,{dataSource:b.dataSource,pagerId:null}),a("#"+e).kendoPager(d))},_selectable:function(){var a=this,b,e,f=a.options.selectable,g=a.options.navigatable;f&&(b=typeof f===p&&f.toLowerCase().indexOf("multiple")>-1,a.selectable=new c.ui.Selectable(a.element,{multiple:b,filter:i,change:function(){a.trigger(d)}}),g&&a.element.keydown(function(c){c.keyCode===h.SPACEBAR&&(e=a.current(),c.preventDefault(),b?c.ctrlKey?e.hasClass(n)&&(e.removeClass(n),e=null):a.selectable.clear():a.selectable.clear(),a.selectable.value(e))}))},current:function(a){var c=this,d=c._current;a!==b&&a.length&&(!d||d[0]!==a[0])&&(a.addClass(l),d&&d.removeClass(l),c._current=a);return c._current},_navigatable:function(){var b=this,c=b.options.navigatable,d=b.element,e=u(b.current,b),f=function(b){e(a(b.currentTarget)),a(b.target).is(":button,a,:input,a>.k-icon,textarea")||d.focus()};c&&(d.attr("tabIndex",Math.max(d.attr("tabIndex")||0,0)),d.bind({focus:function(){var a=b._current;a&&a.is(":visible")?a.addClass(l):e(d.find(i).first())},focusout:function(){b._current&&b._current.removeClass(l)},keydown:function(a){var c=a.keyCode,e=b.current();h.UP===c?b.current(e?e.prev():d.find(i).first()):h.DOWN===c?b.current(e?e.next():d.find(i).first()):h.PAGEUP==c?(b._current=null,b.dataSource.page(b.dataSource.page()-1)):h.PAGEDOWN==c&&(b._current=null,b.dataSource.page(b.dataSource.page()+1))}}),d.addClass(m).delegate("."+m+i,"mousedown",f))},clearSelection:function(){var a=this;a.selectable.clear(),a.trigger(d)},select:function(b){var c=this,d=c.selectable;b=a(b);if(b.length)d.options.multiple||(d.clear(),b=b.first()),d.value(b);else return d.value()},_destroyEditable:function(){var a=this;a.editable&&(a.editable.destroy(),delete a.editable)},_modelFromElement:function(a){var b=a.attr(c.attr("uid"));return this.dataSource.getByUid(b)},_closeEditable:function(b){var d=this,e=d.editable,f,g,h=!0;e&&(b&&(h=e.end()),h&&(f=d._modelFromElement(e.element),g=a(d.template(f)).attr(c.attr("uid"),f.uid),d._destroyEditable(),e.element.replaceWith(g)));return h},edit:function(b){var d=this,e=d._modelFromElement(b),f=a(d.editTemplate(e)).addClass(o);d.cancel(),f.attr(c.attr("uid"),e.uid),b.replaceWith(f),d.editable=f.kendoEditable({model:e,clearContainer:!1,errorTemplate:!1}).data("kendoEditable"),d.trigger(q,{model:e,item:f})},save:function(){var a=this,b=a.editable.element,c=a._modelFromElement(b);!a.trigger(s,{model:c,item:b})&&a._closeEditable(!0)&&a.dataSource.sync()},remove:function(a){var b=this,c=b.dataSource,d=b._modelFromElement(a);b.trigger(r,{model:d,item:a})||(a.hide(),c.remove(d),c.sync())},add:function(){var a=this,b=a.dataSource,c=b.indexOf((b.view()||[])[0]);c<0&&(c=0),a.cancel(),b.insert(c,{}),a.edit(a.element.children().first())},cancel:function(){var a=this,b=a.dataSource;a.editable&&(b.cancelChanges(a._modelFromElement(a.editable.element)),a._closeEditable(!1))},_crudHandlers:function(){var b=this;b.element.on(t,".k-edit-button",function(d){var e=a(this).closest("["+c.attr("uid")+"]");b.edit(e),d.preventDefault()}),b.element.on(t,".k-delete-button",function(d){var e=a(this).closest("["+c.attr("uid")+"]");b.remove(e),d.preventDefault()}),b.element.on(t,".k-update-button",function(a){b.save(),a.preventDefault()}),b.element.on(t,".k-cancel-button",function(a){b.cancel(),a.preventDefault()})}});c.ui.plugin(x)})(jQuery);
+(function(e,t){var a=window.kendo,r="change",n="dataBound",i="dataBinding",l=a.ui.Widget,o=a.keys,s=">*",d="requestStart",c="error",u="k-state-focused",m="k-state-selected",f="k-edit-item",p="string",v="edit",b="remove",g="save",h="click",_=".kendoListView",S=e.proxy,E=a.ui.progress,w=a.data.DataSource,y=l.extend({init:function(t,r){var n=this;r=e.isArray(r)?{dataSource:r}:r,l.fn.init.call(n,t,r),r=n.options,n.wrapper=t=n.element,t[0].id&&(n._itemId=t[0].id+"_lv_active"),n._element(),n._dataSource(),n.template=a.template(r.template||""),n.altTemplate=a.template(r.altTemplate||r.template),n.editTemplate=a.template(r.editTemplate||""),n._navigatable(),n._selectable(),n._pageable(),n._crudHandlers(),n.options.autoBind&&n.dataSource.fetch(),a.notify(n)},events:[r,i,n,v,b,g],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},_item:function(e){return this.element.children()[e]()},items:function(){return this.element.children()},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},_unbindDataSource:function(){var e=this;e.dataSource.unbind(r,e._refreshHandler).unbind(d,e._requestStartHandler).unbind(c,e._errorHandler)},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=S(e.refresh,e),e._requestStartHandler=S(e._requestStart,e),e._errorHandler=S(e._error,e)),e.dataSource=w.create(e.options.dataSource).bind(r,e._refreshHandler).bind(d,e._requestStartHandler).bind(c,e._errorHandler)},_requestStart:function(){E(this.element,!0)},_error:function(){E(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(r){var l,o,s,d,c,u=this,m=u.dataSource.view(),f="",p=u.template,v=u.altTemplate;if(r&&"itemchange"===r.action)return u.editable||(l=r.items[0],d=e.inArray(l,m),d>=0&&(s=e(p(l)).attr(a.attr("uid"),l.uid),u.items().eq(d).replaceWith(s),u.trigger("itemChange",{item:s,data:l}))),t;if(r=r||{},!u.trigger(i,{action:r.action||"rebind",items:r.items,index:r.index})){for(u._destroyEditable(),d=0,c=m.length;c>d;d++)f+=d%2?v(m[d]):p(m[d]);for(u.element.html(f),o=u.items(),d=0,c=m.length;c>d;d++)o.eq(d).attr(a.attr("uid"),m[d].uid).attr("role","option").attr("aria-selected","false");u.element[0]===document.activeElement&&u.options.navigatable&&u.current(o.eq(0)),u.trigger(n)}},_pageable:function(){var t,r,n=this,i=n.options.pageable;e.isPlainObject(i)&&(r=i.pagerId,t=e.extend({},i,{dataSource:n.dataSource,pagerId:null}),n.pager=new a.ui.Pager(e("#"+r),t))},_selectable:function(){var e,n,i=this,l=i.options.selectable,d=i.options.navigatable;l&&(e=typeof l===p&&l.toLowerCase().indexOf("multiple")>-1,e&&i.element.attr("aria-multiselectable",!0),i.selectable=new a.ui.Selectable(i.element,{aria:!0,multiple:e,filter:s,change:function(){i.trigger(r)}}),d&&i.element.on("keydown"+_,function(a){if(a.keyCode===o.SPACEBAR){if(n=i.current(),a.target==a.currentTarget&&a.preventDefault(),e)if(a.ctrlKey){if(n&&n.hasClass(m))return n.removeClass(m),t}else i.selectable.clear();else i.selectable.clear();i.selectable.value(n)}}))},current:function(e){var a=this,r=a.element,n=a._current;return e===t?n:(n&&(n.removeClass(u).removeAttr("id"),r.removeAttr("aria-activedescendant")),e&&e[0]&&(a._scrollTo(e[0]),r.attr("aria-activedescendant",a._itemId),e.addClass(u).attr("id",a._itemId)),a._current=e,t)},_scrollTo:function(t){var a,r=this,n=!1,i="scroll";"auto"==r.wrapper.css("overflow")||r.wrapper.css("overflow")==i?a=r.wrapper[0]:(a=window,n=!0);var l=function(r,l){var o=n?e(t).offset()[r.toLowerCase()]:t["offset"+r],s=t["client"+l],d=e(a)[i+r](),c=e(a)[l.toLowerCase()]();o+s>d+c?e(a)[i+r](o+s-c):d>o&&e(a)[i+r](o)};l("Top","Height"),l("Left","Width")},_navigatable:function(){var t=this,r=t.options.navigatable,n=t.element,i=function(a){t.current(e(a.currentTarget)),e(a.target).is(":button,a,:input,a>.k-icon,textarea")||n.focus()};r&&(t._tabindex(),n.on("focus"+_,function(){var e=t._current;e&&e.is(":visible")||(e=t._item("first")),t.current(e)}).on("focusout"+_,function(){t._current&&t._current.removeClass(u)}).on("keydown"+_,function(r){var i,l=r.keyCode,s=t.current(),d=e(r.target),c=!d.is(":button,textarea,a,a>.t-icon,input"),u=d.is(":text"),m=a.preventDefault,p=n.find("."+f);if(!(!c&&!u&&o.ESC!=l||u&&o.ESC!=l&&o.ENTER!=l))if(o.UP===l||o.LEFT===l)s&&(s=s.prev()),t.current(s&&s[0]?s:t._item("last")),m(r);else if(o.DOWN===l||o.RIGHT===l)s&&(s=s.next()),t.current(s&&s[0]?s:t._item("first")),m(r);else if(o.PAGEUP===l)t.current(null),t.dataSource.page(t.dataSource.page()-1),m(r);else if(o.PAGEDOWN===l)t.current(null),t.dataSource.page(t.dataSource.page()+1),m(r);else if(o.HOME===l)t.current(t._item("first")),m(r);else if(o.END===l)t.current(t._item("last")),m(r);else if(o.ENTER===l)if(0!==p.length&&(c||u)){i=t.items().index(p),document.activeElement.blur(),t.save();var v=function(){t.element.trigger("focus"),t.current(t.items().eq(i))};t.one("dataBound",v)}else""!==t.options.editTemplate&&t.edit(s);else if(o.ESC===l){if(p=n.find("."+f),0===p.length)return;i=t.items().index(p),t.cancel(),t.element.trigger("focus"),t.current(t.items().eq(i))}}),n.on("mousedown"+_+" touchstart"+_,s,S(i,t)))},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(r)},select:function(a){var r=this,n=r.selectable;return a=e(a),a.length?(n.options.multiple||(n.clear(),a=a.first()),n.value(a),t):n.value()},_destroyEditable:function(){var e=this;e.editable&&(e.editable.destroy(),delete e.editable)},_modelFromElement:function(e){var t=e.attr(a.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(t){var r,n,i=this,l=i.editable,o=!0;return l&&(t&&(o=l.end()),o&&(r=i._modelFromElement(l.element),n=e(i.template(r)).attr(a.attr("uid"),r.uid),i._destroyEditable(),l.element.replaceWith(n))),o},edit:function(t){var r=this,n=r._modelFromElement(t),i=e(r.editTemplate(n)).addClass(f);r.cancel(),i.attr(a.attr("uid"),n.uid),t.replaceWith(i),r.editable=i.kendoEditable({model:n,clearContainer:!1,errorTemplate:!1}).data("kendoEditable"),r.trigger(v,{model:n,item:i})},save:function(){var e=this,t=e.editable.element,a=e._modelFromElement(t);!e.trigger(g,{model:a,item:t})&&e._closeEditable(!0)&&e.dataSource.sync()},remove:function(e){var t=this,a=t.dataSource,r=t._modelFromElement(e);t.trigger(b,{model:r,item:e})||(e.hide(),a.remove(r),a.sync())},add:function(){var e=this,t=e.dataSource,a=t.indexOf((t.view()||[])[0]);0>a&&(a=0),e.cancel(),t.insert(a,{}),e.edit(e.element.children().first())},cancel:function(){var e=this,t=e.dataSource;e.editable&&(t.cancelChanges(e._modelFromElement(e.editable.element)),e._closeEditable(!1))},_crudHandlers:function(){var t=this,r="touchend"+_+" "+h+_;t.element.on(r,".k-edit-button",function(r){var n=e(this).closest("["+a.attr("uid")+"]");t.edit(n),r.preventDefault()}),t.element.on(r,".k-delete-button",function(r){var n=e(this).closest("["+a.attr("uid")+"]");t.remove(n),r.preventDefault()}),t.element.on(r,".k-update-button",function(e){t.save(),e.preventDefault()}),t.element.on(r,".k-cancel-button",function(e){t.cancel(),e.preventDefault()})},destroy:function(){var e=this;l.fn.destroy.call(e),e._unbindDataSource(),e._destroyEditable(),e.element.off(_),e.pager&&e.pager.destroy(),e.selectable&&e.selectable.destroy(),a.destroy(e.element)}});a.ui.plugin(y)})(window.kendo.jQuery);
\ No newline at end of file