From 0715878e35bc8d839a547fbfc16eacd6d2bb777c Mon Sep 17 00:00:00 2001 From: Bill Keese Date: Wed, 31 Dec 2014 11:18:29 +0900 Subject: [PATCH] use new notifyCurrentValue() varargs api, refs ibm-js/decor#14 --- ProgressBar.js | 3 +-- SidePane.js | 3 +-- Slider.js | 9 +++------ StarRating.js | 4 +--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ProgressBar.js b/ProgressBar.js index 5b5d1413da..7f8e0b4bb5 100644 --- a/ProgressBar.js +++ b/ProgressBar.js @@ -159,8 +159,7 @@ define([ }, postRender: function () { - this.notifyCurrentValue("value"); - this.notifyCurrentValue("max"); + this.notifyCurrentValue("value", "max"); }, /** diff --git a/SidePane.js b/SidePane.js index 2eff68adde..20bb8fd0cc 100644 --- a/SidePane.js +++ b/SidePane.js @@ -230,8 +230,7 @@ define([ setVisibility(this, false); // trigger refreshRendering() to run and apply mode & position even if they are the default values - this.notifyCurrentValue("mode"); - this.notifyCurrentValue("position"); + this.notifyCurrentValue("mode", "position"); }, preRender: function () { diff --git a/Slider.js b/Slider.js index 28cdf59385..42d05f4aa0 100644 --- a/Slider.js +++ b/Slider.js @@ -338,11 +338,8 @@ define([ this.on("focus", this.focusHandler.bind(this)); this.on("focus", this.focusHandler.bind(this)); - // ensure CSS is applied - this.notifyCurrentValue("vertical"); - - // apply default tabIndex in case the app doesn't specific tabindex explicitly - this.notifyCurrentValue("tabIndex"); + // ensure CSS is applied, and apply default tabIndex in case the app doesn't specify tabindex explicitly + this.notifyCurrentValue("vertical", "tabIndex"); if (this.valueNode.value) { // INPUT value // browser back button or value coded on INPUT @@ -351,7 +348,7 @@ define([ } // force calculation of the default value in case it is not specified. - ["min", "max", "step", "value"].forEach(this.notifyCurrentValue, this); + this.notifyCurrentValue("min", "max", "step", "value"); }, attachedCallback: function () { diff --git a/StarRating.js b/StarRating.js index f4d1c9a94e..1090718c85 100644 --- a/StarRating.js +++ b/StarRating.js @@ -97,9 +97,7 @@ define([ this.valueNode.style.display = "none"; this.appendChild(this.valueNode); } - ["disabled", "max", "value", "name", "readOnly", "allowZero"].forEach(function (prop) { - this.notifyCurrentValue(prop); - }, this); + this.notifyCurrentValue("disabled", "max", "value", "name", "readOnly", "allowZero"); }), /* jshint maxcomplexity: 13 */