Sha256: 957a033304886bf0f384fd7bc105aa29296cc5bf7b2083c5600bce3e3e28b473

Contents?: true

Size: 1.14 KB

Versions: 21

Compression:

Stored size: 1.14 KB

Contents

pageflow.linkmapPage.ScaledOnPhoneHintView = Backbone.Marionette.ItemView.extend({
  template: 'pageflow/linkmap_page/editor/templates/scaled_on_phone_hint',
  className: 'scaled_on_phone_hint',

  modelEvents: {
    'change:scaled_on_portrait_phone change:scaled_on_landscape_phone': 'update'
  },

  ui: {
    hint: 'p'
  },

  onRender: function() {
    this.update();
  },

  update: function() {
    this.$el.toggle(this.model.get('scaled_on_portrait_phone') ||
                    this.model.get('scaled_on_landscape_phone'));

    if (this.model.get('scaled_on_portrait_phone') &&
        this.model.get('scaled_on_landscape_phone')) {
      this.ui.hint.text(this.hintText('both'));
    }
    else if (this.model.get('scaled_on_portrait_phone')) {
      this.ui.hint.text(this.hintText('portrait'));
    }
    else if (this.model.get('scaled_on_landscape_phone')) {
      this.ui.hint.text(this.hintText('landscape'));
    }
  },

  hintText: function(orientation) {
    var prefix = 'pageflow.linkmap_page.editor.views.scaled_on_phone_hint';
    return I18n.t(prefix + '.text', {
      orientation: I18n.t(prefix + '.orientations.' + orientation)
    });
  }
});

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pageflow-linkmap-page-2.10.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.9.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.8.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.7.1 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.7.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.6.1 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.6.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.5.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.4.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.3.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.2.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.5.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.1.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.4.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-2.0.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.3.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.2.1 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.2.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.1.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js
pageflow-linkmap-page-1.0.0 app/assets/javascript/pageflow/linkmap_page/editor/views/scaled_on_phone_hint_view.js