| Current Path : /var/www/iplanru/data/old/www/i-plan.ru/administrator/components/com_zoo/assets/js/ |
| Current File : /var/www/iplanru/data/old/www/i-plan.ru/administrator/components/com_zoo/assets/js/category.js |
/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */
(function(b){var a=function(){};b.extend(a.prototype,{name:"SortCategories",initialize:function(a){var c=b("#categories");c&&c.nestedSortable({forcePlaceholderSize:true,handle:"td.handle",items:"li",placeholder:"placeholder",tabSize:25,tolerance:"pointer",toleranceElement:"> div",listType:"ul",start:function(b,a){a.placeholder.height(a.helper.height()-2);a.helper.addClass("drag")},stop:function(d,f){var g={};b.each(a.serializeArray(),function(b,a){g[a.name]=a.value});f.item.addClass("loader").find("li").addClass("loader");
b.post(a.attr("action"),b.param(b.extend(g,{task:"saveorder",format:"raw"}))+"&"+c.nestedSortable("serialize"),function(d){c.find("li").removeClass("loader");b.Message(d,true);a.BrowseCategories("markCollapsibles")});f.item.removeClass("drag")}})}});b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&c!="initialize")d.data(a.prototype.name)[c].apply(d.data(a.prototype.name),Array.prototype.slice.call(e,
1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery);
(function(b){var a=function(){};b.extend(a.prototype,{name:"BrowseCategories",initialize:function(){b("#categories").delegate("li.collapsible > div td.icon","click",function(){var a=b(this).closest("li");a.is(".collapsed")?a.removeClass("collapsed").children("ul").show():a.addClass("collapsed").children("ul").hide()});b("#categories-list .collapse-all").bind("click",function(){b("#categories li.collapsible").each(function(){b(this).addClass("collapsed").children("ul").hide()})});b("#categories-list .expand-all").bind("click",
function(){b("#categories li.collapsible").each(function(){b(this).removeClass("collapsed").children("ul").show()})});this.markCollapsibles()},markCollapsibles:function(){b("#categories").find("li").each(function(){b(this).removeClass("collapsible");b(this).has("ul").length&&b(this).addClass("collapsible")})}});b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&c!="initialize")d.data(a.prototype.name)[c].apply(d.data(a.prototype.name),
Array.prototype.slice.call(e,1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery);
(function(b){var a=function(){};b.extend(a.prototype,{name:"EditCategory",initialize:function(a){b.each(["apply","save","saveandnew"],function(c,d){b("#toolbar-"+d+" a").bind("validate.adminForm",function(b){a.find('input[name="name"]').val()==""&&(a.find("span.message-name").css("display","block"),b.preventDefault())})})}});b.fn[a.prototype.name]=function(){var e=arguments,c=e[0]?e[0]:null;return this.each(function(){var d=b(this);if(a.prototype[c]&&d.data(a.prototype.name)&&c!="initialize")d.data(a.prototype.name)[c].apply(d.data(a.prototype.name),
Array.prototype.slice.call(e,1));else if(!c||b.isPlainObject(c)){var f=new a;a.prototype.initialize&&f.initialize.apply(f,b.merge([d],e));d.data(a.prototype.name,f)}else b.error("Method "+c+" does not exist on jQuery."+a.name)})}})(jQuery);