Hey sometimes I have to admit, we’re really out of our minds. I was programming a publish function for an article and, I got this bug, it’s so funny I’ve decided to make a post out of it. Here’s the code :


PublishArticle: function(){

if(this.PublishButton.get("label") == "Publish"){
this.State = "Published";
this.SaveArticle();
this.PublishButton.set("label", "Unpublish");
}
if(this.PublishButton.get("label") == "Unpublish"){
this.State = "Draft";
this.SaveArticle();
this.PublishButton.set("label", "Publish");
}
},

Aint’ that crazy ?