title: Backbone, Marionette - synchronous execution
body: <p>I have a function in my marionette LayoutView that has the following ui and events blocks:</p>
  
  <pre><code> ui: {
          runAction: ".picasso-form-action-run"
   },
  
   events: {
          "click @ui.runAction": "runFilter"
   },
  </code></pre>
  
  <p>The runFilter function looks like this:</p>
  
  <pre><code>runFilter: function(e) {
          e.preventDefault();
          e.stopPropagation();
          var _this = this;
  
          _this.ui.runAction.addClass('processing');
          _this.ui.runAction.text('Processing');
          _this.ui.runAction.attr('disabled', 'disabled');
  
          setTimeout(function() {
              _this.trigger("whiteboard:data:refresh"); // this fetch data
          }, 5);
      }
  </code></pre>
  
  <p>My question is, I need to change the runAction button's text before I fetch new data, but the only way I can get this to work is to add a timeout to the trigger. This seems like a hack and would like to know what is the right way to do this.</p>
  
  <p>The object that listens to the trigger, loads new data from the DB and renders a region.</p>
  
  <p>Any help please.</p>