Sha256: dfa0af5cc0a09498b74e505cdc5406e9259c98a50e0dd15ad1d1b25a6eb9a528
Contents?: true
Size: 792 Bytes
Versions: 12
Compression:
Stored size: 792 Bytes
Contents
(function() { "use strict"; App.PostsShowController = Ember.ObjectController.extend({ needs: ['posts'], actions: { togglePublished: function(defer) { var post = this.get('content'); if (Ember.isNone(post.get('publishedAt'))) { post.set('publishedAt', new Date()); } else { post.set('publishedAt', null); } if (Ember.isNone(defer)) { post.save(); return post; } if (!post.get('isDirty')) { defer.resolve(); } else { post.save().then(function() { defer.resolve(); }, function() { defer.reject(); }); } return post; } } }); })();
Version data entries
12 entries across 12 versions & 1 rubygems