Sha256: 008407285c44c7d00a2d66c2d496777826eb7d30a7159037f5b9308096815fd3

Contents?: true

Size: 976 Bytes

Versions: 211

Compression:

Stored size: 976 Bytes

Contents

HAL.Views.LocationBar = Backbone.View.extend({
  initialize: function(opts) {
    this.vent = opts.vent;
    _.bindAll(this, 'render');
    _.bindAll(this, 'onButtonClick');
    this.vent.bind('location-change', this.render);
    this.vent.bind('location-change', _.bind(this.showSpinner, this));
    this.vent.bind('response', _.bind(this.hideSpinner, this));
  },

  events: {
    'submit form': 'onButtonClick'
  },

  className: 'address',

  render: function(e) {
    e = e || { url: '' };
    this.$el.html(this.template(e));
  },

  onButtonClick: function(e) {
    e.preventDefault();
    this.vent.trigger('location-go', this.getLocation());
  },

  getLocation: function() {
    return this.$el.find('input').val();
  },

  showSpinner: function() {
    this.$el.find('.ajax-loader').addClass('visible');
  },

  hideSpinner: function() {
    this.$el.find('.ajax-loader').removeClass('visible');
  },

  template: _.template($('#location-bar-template').html())
});

Version data entries

211 entries across 211 versions & 1 rubygems

Version Path
pact_broker-2.112.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.111.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.109.1 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.109.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.108.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.107.1 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.107.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.107.0.beta.1 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.106.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.105.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.104.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.103.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.102.2 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.102.1 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.102.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.101.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.100.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.99.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.98.0 vendor/hal-browser/js/hal/views/location_bar.js
pact_broker-2.97.0 vendor/hal-browser/js/hal/views/location_bar.js