Checklist for JIRA with JIRA 7.1.9 :
/* module-key = 'com.okapya.jira.checklist:checklist-resources', location = '/includes/js/checklist.view.js' */ (function(a){a.createChecklistView=function(c,l){var k=null;var m=null;var d=false;var b=false;var i=false;var e=l;var g=new a.checklist.checklistItemsCol();function j(o,n){if(_.isNull(n)||_.isUndefined(n)){return}g.comparator="rank";g.reset(n,{silent:true});if(m!=null){m.undelegateEvents();m.$(".o-show-items").off("click");m.$el.find(".o-checklist-items").empty();m.$el.find(".o-checklist-items-collapsible").empty();m.header.undelegateEvents();m.header.$el.empty()}m=new f({model:new a.checklist.checklistModel(o)});m.render();m.$(".o-show-items").click({self:m},m.toggleShowMore)}var f=a.Backbone.View.extend({events:{},initialize:function(){this.$el=AJS.$("#o-checklist-view-"+this.model.id);this.model.set("expanded",false);if(g.length){this.header=new a.checklist.header({el:this.$(".o-checklist-header"),model:{items:g,customfieldId:this.model.get("id"),showMenu:false}});this.listenTo(this.header,"toggleFilter",this.toggleFilter,this)}this.filtered=false},toggleFilter:function(){this.filtered=!this.filtered;this.$el.find(".o-checklist-items").empty();this.$el.find(".o-checklist-items-collapsible").empty();this.render()},render:function(){var s=this;var n=null;this.renderHeader();var q=this.model.get("parameters");var r=this.filtered?g.models.filter(function(t){return !t.get("checked")}):g.models;var p=q.showMoreCount;_.each(r,function(u,t){s=(p==0||t<p)?this.$(".o-checklist-items"):this.$(".o-checklist-items-collapsible");s.append(a.tpl.renderChecklistItemView({checked:u.get("checked"),text:a.marked(u.get("name"),u.get("optionId")<=0),mandatory:u.get("mandatory"),status:u.getStatus(),parameters:q}))},this);var o=this.model.get("parameters").showMoreCount;if(o==0||r.length<=0||o>=r.length){this.$("a.o-show-items").addClass("o-show-all")}else{this.$("a.o-show-items").removeClass("o-show-all")}},renderHeader:function(){if(_.isNull(this.header)||_.isUndefined(this.header)){return}this.header.render()},toggleShowMore:function(n){n.data.self.$("a.o-show-items").toggleClass("o-expanded");n.data.self.$(".o-checklist-items-collapsible").toggle()}});var h=function(p){var o=false;e=p;if(!_.isNull(e)&&!_.isUndefined(e)){if(AJS.$("#o-checklist-view-"+c.id).length>0){j(c,e);o=true;if(!d){d=true;JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED,function(u,r,t){if(t==JIRA.CONTENT_ADDED_REASON.panelRefreshed&&r.attr("id")==(c.customfieldId+"-val")){var s=JSON.parse(AJS.$("#o-checklist-view-"+c.id+"-data")[0].value);j(c,s)}})}}else{if(!b){b=true;JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED,function(t,r,s){if(s==JIRA.CONTENT_ADDED_REASON.pageLoad){if(r.find("#"+c.customfieldId+"-val").size()>0){j(c,e)}}})}}var q=AJS.$("#ghx-detail-contents");if(q.size()>0){var n=function(){if(!(m&&q.find(m.$el).size()>0)){var r=q.find("#o-checklist-view-"+c.id+"-data");if(r.size()>0){j(c,JSON.parse(r[0].value))}}};q.bind("DOMSubtreeModified",n)}}};h(l);return{view:m,registerData:h}}})(okapya);; ; caught TypeError: Cannot read property 'undelegateEvents' of batch.js?agile_global_admin_condition=true&is-server-instance=true&is-system-admin=true&jag=true&ja…:4886 Uncaught TypeError: Cannot read property 'undelegateEvents' of undefined
can you put your fix into production please so we can deploy it to our JIRA ?
Thanks.
Thank you Stephanie!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephanie,
I wasn't really able to reproduce.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes it happens constantly when we are switching between bugs on loading a bug it shows a white screen and nothing can be clicked. the javascript console shows the error above. hitting reload reloads the bug correctly.
please fix quickly as this is a blocker for us.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephanie,
Is this something that always happen or is it something that happens once in a while? Can you constantly reproduce it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.