Sha256: fba16133bebacd3bd6b67a4e20c56ccab7943eee3aba3b49ea3d00416888111d

Contents?: true

Size: 1.25 KB

Versions: 67

Compression:

Stored size: 1.25 KB

Contents

pageflow.commonPageCssClasses = {
  updateCommonPageCssClasses: function(pageElement, configuration) {
    pageElement.toggleClass('invert', configuration.get('invert'));
    pageElement.toggleClass('hide_title', configuration.get('hide_title'));

    toggleModeClass(pageflow.Page.textPositions, 'text_position');
    toggleModeClass(pageflow.Page.delayedTextFadeIn, 'delayed_text_fade_in');
    toggleModeClass(pageflow.Page.scrollIndicatorModes, 'scroll_indicator_mode');
    toggleModeClass(pageflow.Page.scrollIndicatorOrientations, 'scroll_indicator_orientation');

    function toggleModeClass(modes, name) {
      var value = configuration.get(name);

      _.each(modes, function(mode) {
        pageElement.removeClass(name + '_' + mode);
      });

      if (value) {
        pageElement.addClass(name + '_' + value);
      }
    }

    pageElement.toggleClass('no_text_content', !hasContent());

    function hasContent() {
      var hasTitle = _(['title','subtitle','tagline']).some(function(attribute) {
        return !!$.trim(configuration.get(attribute));
      });

      var text = $('<div />').html(configuration.get('text')).text();
      var hasText = !!$.trim(text);

      return (hasTitle && !configuration.get('hide_title')) || hasText;
    }
  }
};

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.2 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.1 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.5.1 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.5.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0.rc2 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0.rc1 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0.beta4 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0.beta3 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.4.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0.beta2 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-15.0.0.beta1 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.3.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.2.1 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.2.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.1.1 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.1.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.0.0 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js
pageflow-14.0.0.rc2 app/assets/javascripts/pageflow/page_types/mixins/common_page_css_classes.js