Sha256: 438d66ed9a563ce8c34fde097c578b24cc7425907a4f0898ff12eefb67dbd2fc

Contents?: true

Size: 1022 Bytes

Versions: 8

Compression:

Stored size: 1022 Bytes

Contents

rio.components.Base = rio.Component.create("Base", {
	attrReaders: [
		["className", ""],
		["seleniumId", ""]
	],
	styles: ["position", "top", "right", "bottom", "left", "display"],
	methods: {
		html: function() {
			if (!this._html) { 
				this._html = this.buildHtml();
				this._html.addClassName(this.getClassName());
				
				if (rio.environment.supportSelenium) {
					this._html.id = this.getSeleniumId();
				}
				
				this._html.applyStyle({
					position: this.position,
					top: this.top,
					right: this.right,
					bottom: this.bottom,
					left: this.left,
					display: this.display
				});
			}
			return this._html;
		},
		
		addClassName: function(className) {
			this.html().addClassName(className);
			this._className = this.html().className;
		},

		removeClassName: function(className) {
			this.html().removeClassName(className);
			this._className = this.html().className;
		},
		
		show: function() {
			this.setDisplay("");
		},
		
		hide: function() {
			this.setDisplay("none");
		}
	}
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
riojs-0.0.7 public/javascripts/components/base.js
riojs-0.0.6 public/javascripts/components/base.js
riojs-0.0.5 public/javascripts/components/base.js
riojs-0.0.4 public/javascripts/components/base.js
riojs-0.0.3 public/javascripts/components/base.js
riojs-0.0.2 public/javascripts/components/base.js
riojs-0.0.1 public/javascripts/components/base.js
riojs-0.0.0 public/javascripts/components/base.js