procurementCenter.js
1.02 KB
/*! dili 2016-01-06 */
define("simpleTree",function(require,exports,module){var simpleTree=function(elem,opt){this.elem=elem,this.opt={handler:".title",toggleClass:"title_selected",showtarget:"ul",currentClass:".menu-list-current"},$.extend(this.opt,opt),this.init()};return simpleTree.prototype={init:function(){var elem=$(this.elem),_this=this;elem.find(_this.opt.currentClass).parents(_this.opt.showtarget).show(),elem.find(_this.opt.currentClass).parents(_this.opt.showtarget).prev().find(_this.opt.handler).addClass(_this.opt.toggleClass),this.bind()},bind:function(){var elem=$(this.elem),_this=this;elem.find(_this.opt.handler).bind("click",function(){_this.animate()})},animate:function(){var elem=$(this.elem),_this=this,_title=elem.find(_this.opt.handler);_title.hasClass(_this.opt.toggleClass)?_title.removeClass(_this.opt.toggleClass):_title.addClass(_this.opt.toggleClass),_title.parents().find(elem.find(_this.opt.showtarget)).animate({height:"toggle"},100)}},simpleTree}),define(function(require,exports,module){$(function(){})});