window.VcEventZillaView=vc.shortcode_view.extend({adding_new_tab:!1,events:{"click .add_tab":"addTab","click > .vc_controls .column_delete, > .vc_controls .vc_control-btn-delete":"deleteShortcode","click > .vc_controls .column_edit, > .vc_controls .vc_control-btn-edit":"editElement","click > .vc_controls .column_clone,> .vc_controls .vc_control-btn-clone":"clone"},render:function(){window.VcEventZillaView.__super__.render.call(this);this.$content.sortable({axis:"y",handle:"h3",
stop:function(a,b){b.item.prev().triggerHandler("focusout");jQuery(this).find("> .wpb_sortable").each(function(){jQuery(this).data("model").save({order:jQuery(this).index()})})}});return this},changeShortcodeParams:function(a){window.VcEventZillaView.__super__.changeShortcodeParams.call(this,a);a=_.isString(this.model.get("params").collapsible)&&"yes"===this.model.get("params").collapsible?!0:!1;this.$content.hasClass("ui-accordion")&&this.$content.accordion("option","collapsible",a)},changedContent:function(a){this.$content.hasClass("ui-accordion")&&
this.$content.accordion("destroy");var b=_.isString(this.model.get("params").collapsible)&&"yes"===this.model.get("params").collapsible?!0:!1;this.$content.accordion({header:"h3",navigation:!1,autoHeight:!0,heightStyle:"content",collapsible:b,active:!1===this.adding_new_tab&&!0!==a.model.get("cloned")?0:a.$el.index()});this.adding_new_tab=!1},addTab:function(a){this.adding_new_tab=!0;a.preventDefault();vc.shortcodes.create({shortcode:"eventzilla_playlist_item",params:{title:"Playlist Item - NEW"},
parent_id:this.model.id})},_loadDefaults:function(){window.VcEventZillaView.__super__._loadDefaults.call(this)}});
