Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/i-plan.ru/media/zoo/elements/textarea/
Upload File :
Current File : /var/www/iplanru/data/www/i-plan.ru/media/zoo/elements/textarea/textarea.js

/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

(function(e){var t=function(){};e.extend(t.prototype,{name:"ElementRepeatableTextarea",initialize:function(t){var i=t.find("ul.repeatable-list");i.find("li.hidden").each(function(){e(this).find("*").each(function(){if(e(this).attr("name")){e(this).data("name",e(this).attr("name"));e(this).attr("name","")}})});t.delegate("span.delete","click",function(){e(this).closest("li.repeatable-element").fadeOut(200,function(){e(this).addClass("hidden");e(this).find("*").each(function(){if(e(this).attr("name")){e(this).attr("name","")}})})});t.find("p.add a").bind("click",function(){var t=e(i.find("li.hidden").get(0)).removeClass("hidden");t.find("*").each(function(){if(e(this).data("name"))e(this).attr("name",e(this).data("name"))});t.find("div.repeatable-content").effect("highlight",{},1e3);if(i.find("li.hidden").length==0)e(this).parent().hide()})}});e.fn[t.prototype.name]=function(){var i=arguments;var a=i[0]?i[0]:null;return this.each(function(){var n=e(this);if(t.prototype[a]&&n.data(t.prototype.name)&&a!="initialize"){n.data(t.prototype.name)[a].apply(n.data(t.prototype.name),Array.prototype.slice.call(i,1))}else if(!a||e.isPlainObject(a)){var d=new t;if(t.prototype["initialize"]){d.initialize.apply(d,e.merge([n],i))}n.data(t.prototype.name,d)}else{e.error("Method "+a+" does not exist on jQuery."+t.name)}})}})(jQuery);