Sha256: cbdca1c334074c50360a96c679e6f237478548de98290748cce0e9d8c1af5c5d

Contents?: true

Size: 1017 Bytes

Versions: 12

Compression:

Stored size: 1017 Bytes

Contents

pageflow.LockedView = Backbone.Marionette.ItemView.extend({
  template: 'templates/locked',
  className: 'locked checking',

  ui: {
    breakButton: '.break',
    message: '.error .message'
  },

  events: {
    'click .close': 'goBack',

    'click .break': 'breakLock'
  },

  modelEvents: {
    aquired: 'hide',

    locked: 'show',
  },

  breakLock: function() {
    this.model.aquire({force: true});
  },

  goBack: function() {
    window.location = "/admin/entries/" + pageflow.entry.id;
  },

  show: function(info, options) {
    var key = info.error + '.' + options.context;

    this.ui.message.html(I18n.t('edit_locks.errors.' + key + '_html', {user_name: info.held_by}));
    this.ui.message.attr('data-error', key);

    this.ui.breakButton.text(I18n.t('edit_locks.break_action.' + options.context));

    this.$el.removeClass('checking');
    this.$el.show();
  },

  hide: function() {
    this.ui.message.attr('data-error', null);

    this.$el.removeClass('checking');
    this.$el.hide();
  }
});

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pageflow-0.6.0 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.5.0 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.4.0 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.3.0 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.2.1 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.2.0 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.1.0 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.0.5 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.0.4 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.0.3 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.0.2 app/assets/javascripts/pageflow/editor/views/locked_view.js
pageflow-0.0.1 app/assets/javascripts/pageflow/editor/views/locked_view.js