123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- define(function () {
- "use strict";
- function Control() {
- };
- Control.prototype.draw = function (oControlHost) {
- var div = oControlHost.container;
- var o = oControlHost.configuration;
- if ( !o )
- {
- throw new scriptableReportError( "Swap Measures", "", "Expected configuration." );
- }
- var sStyle =
- '<style>' +
- "#" + div.id + '{ padding-left: ' + o["Padding left"] + '; padding-right: ' + o["Padding right"] + '; padding-top: ' + o["Padding top"] + '; padding-bottom: ' + o["Padding bottom"] + '; } \r' +
- "#" + div.id + ':hover { color: ' + o["Hover label color"] + '; font-weight: bold; background-color: ' + o["Hover background color"] + '; } \r' +
- "#" + div.id + ':focus { color:green; font-weight: bold; background-color: yellow; } \r' +
- "#" + div.id + ':active { color: ' + o["Click label color"] + '; font-weight: bold; background-color: ' + o["Click background color"] + '; }' +
- '</style>';
-
- div.innerHTML = sStyle + oControlHost.configuration["Button label"] ;
- div.onclick = this.f_onClick.bind(this, oControlHost);
- div.style.cursor = "pointer";
-
- };
- Control.prototype.getParameters = function (oControlHost) {
- return [ {
- "parameter": oControlHost.configuration["Parameter"],
- "values": [ {
- "use" : oControlHost.configuration["Button value"], "display" : oControlHost.configuration["Button label"]
- }]
- }
- ];
- };
- Control.prototype.f_onClick = function (oControlHost) {
- oControlHost.valueChanged();
- oControlHost.next();
- };
- return Control;
- });
|