Sha256: a3d00352190075f68be211bc19a8d0abdfc82462796eef09ae275da51885b849

Contents?: true

Size: 1.89 KB

Versions: 20

Compression:

Stored size: 1.89 KB

Contents

/*** = Description
  ** HStringView is a view component that represents a non-editable line of text. 
  ** Commonly, stringview is used as a label to control elements 
  ** that do not have implicit labels (text fields, checkboxes and radio buttons, and menus). 
  ** Some form controls automatically have labels associated with them (press buttons) 
  ** while most do not have (text fields, checkboxes and radio buttons, and sliders etc.).  
  **
  ** = Instance variables
  ** +type+::   '[HStringView]'
  ** +value+::  The string that this string view displays when drawn.
  ***/
var HStringView, HLabel;

(function(){
  var _HStringViewInterface = {

    componentName: "stringview",
    
    // allows text selection
    textSelectable: true,

  /** = Description
    * The setStyle method of HStringView applies only to the value
    * element (not the whole component).
    *
    **/
    setStyle: function(_name, _value, _cacheOverride) {
      if (!this['markupElemIds']||!this.markupElemIds['value']) {
        return this;
      }
      this.setStyleOfPart( 'value', _name, _value, _cacheOverride);
      return this;
    },
    
  /** = Description
    * The refreshLabel of HStringView sets a tool tip.
    * Applied by the setLabel method and the label attribute of options.
    *
    **/
    refreshLabel: function() {
      if(this.markupElemIds && this.markupElemIds.value) {
        if( this.value !== undefined ){
          this.setAttrOfPart( 'value', 'title', this.label );
        }
        else {
          this.setMarkupOfPart( 'value', this.label );
        }
      }
    }
  };

  HLabel = HView.extend( _HStringViewInterface );
  HStringView = HControl.extend( _HStringViewInterface ).extend({
    defaultEvents: {
      contextMenu: true
    },
    
  /** = Description
    * HStringView allows the default contextMenu action.
    *
    **/
    contextMenu: function(){
      return true;
    }
  });

})();

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rsence-pre-3.0.0.8 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.7 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.6 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.5 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.4 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.3 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.2 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.1 client/js/controls/stringview/stringview.js
rsence-pre-3.0.0.0 client/js/controls/stringview/stringview.js
rsence-pre-2.3.0.26 js/controls/stringview/stringview.js
rsence-pre-2.3.0.25 js/controls/stringview/stringview.js
rsence-pre-2.3.0.24 js/controls/stringview/stringview.js
rsence-pre-2.3.0.23 js/controls/stringview/stringview.js
rsence-pre-2.3.0.22 js/controls/stringview/stringview.js
rsence-pre-2.3.0.21 js/controls/stringview/stringview.js
rsence-pre-2.3.0.20 js/controls/stringview/stringview.js
rsence-pre-2.3.0.19 js/controls/stringview/stringview.js
rsence-pre-2.3.0.18 js/controls/stringview/stringview.js
rsence-pre-2.3.0.17 js/controls/stringview/stringview.js
rsence-pre-2.3.0.16 js/controls/stringview/stringview.js