diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 901a8c11b..e54737660 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -144,6 +144,8 @@ app.views.Publisher = Backbone.View.extend({ var serializedForm = $(evt.target).closest("form").serializeObject(); // disable input while posting, must be after the form is serialized this.setInputEnabled(false); + this.setButtonsEnabled(false); + this.$('#publisher_spinner').removeClass('hidden'); // lulz this code should be killed. var statusMessage = new app.models.Post(); @@ -179,6 +181,8 @@ app.views.Publisher = Backbone.View.extend({ error: function() { if( app.publisher ) app.publisher.trigger('publisher:error'); self.setInputEnabled(true); + self.setButtonsEnabled(true); + self.$('#publisher_spinner').addClass('hidden'); } }); }, @@ -346,6 +350,12 @@ app.views.Publisher = Backbone.View.extend({ // enable input this.setInputEnabled(true); + + // enable buttons + this.setButtonsEnabled(false); + + // hide spinner + this.$('#publisher_spinner').addClass('hidden'); // clear location this.destroyLocation(); diff --git a/app/assets/stylesheets/publisher_blueprint.css.scss b/app/assets/stylesheets/publisher_blueprint.css.scss index 3cbb468a2..15a51daf7 100644 --- a/app/assets/stylesheets/publisher_blueprint.css.scss +++ b/app/assets/stylesheets/publisher_blueprint.css.scss @@ -70,6 +70,12 @@ } } + #publisher_spinner { + position: relative; + top: 3px; + margin-right: 10px; + } + #publisher_service_icons { position: relative; top: 3px; diff --git a/app/views/publisher/_publisher_blueprint.html.haml b/app/views/publisher/_publisher_blueprint.html.haml index 68ea93d6f..bbfe3c9d7 100644 --- a/app/views/publisher/_publisher_blueprint.html.haml +++ b/app/views/publisher/_publisher_blueprint.html.haml @@ -49,6 +49,8 @@ .options_and_submit .public_toggle + %span#publisher_spinner{:class => 'hidden'} + = image_tag 'ajax-loader.gif' %span#publisher_service_icons - if current_user.services - for service in current_user.services diff --git a/app/views/publisher/_publisher_bootstrap.html.haml b/app/views/publisher/_publisher_bootstrap.html.haml index a35f22d36..7528e9706 100644 --- a/app/views/publisher/_publisher_bootstrap.html.haml +++ b/app/views/publisher/_publisher_bootstrap.html.haml @@ -60,6 +60,8 @@ =t('cancel') .btn-toolbar.pull-right + %span#publisher_spinner{:class => 'hidden'} + = image_tag 'ajax-loader.gif' %span#publisher_service_icons - if current_user.services - for service in current_user.services