Repository: flex-asjs Updated Branches: refs/heads/develop 6168c17d1 -> 1a580f49a
get DDL to respond to outer class styles Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/2fb5a501 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/2fb5a501 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/2fb5a501 Branch: refs/heads/develop Commit: 2fb5a50156534bb18576452045aafcd2b71c0d3e Parents: 6168c17 Author: Alex Harui <[email protected]> Authored: Mon Sep 14 16:40:33 2015 -0700 Committer: Alex Harui <[email protected]> Committed: Mon Sep 14 16:40:33 2015 -0700 ---------------------------------------------------------------------- .../js/src/org/apache/flex/flat/DropDownList.js | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2fb5a501/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js b/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js index ef6d3f5..1916d5b 100644 --- a/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js +++ b/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js @@ -16,6 +16,7 @@ goog.provide('org.apache.flex.flat.DropDownList'); goog.require('org.apache.flex.core.ListBase'); goog.require('org.apache.flex.html.beads.models.ArraySelectionModel'); +goog.require('org.apache.flex.utils.Language'); @@ -52,6 +53,8 @@ org.apache.flex.flat.DropDownList.prototype.createElement = this.button = button = document.createElement('button'); button.className = 'dropdown-toggle-open-btn'; + if (this.className) + button.className += ' ' + this.className; goog.events.listen(button, 'click', goog.bind(this.buttonClicked, this)); this.element.appendChild(button); @@ -148,7 +151,9 @@ org.apache.flex.flat.DropDownList.prototype.buttonClicked = */ this.menu = select = document.createElement('ul'); - select.style.width = width.toString() + 'px'; + var el = /** @type {Element} */ (this.element); + var cv = window.getComputedStyle(el); + select.style.width = cv.width; goog.events.listen(select, 'click', goog.bind(this.selectChanged, this)); select.className = 'dropdown-menu'; @@ -177,6 +182,22 @@ org.apache.flex.flat.DropDownList.prototype.buttonClicked = Object.defineProperties(org.apache.flex.flat.DropDownList.prototype, { + /** @export */ + className: { + /** @this {org.apache.flex.flat.DropDownList} */ + get: function() { + return org.apache.flex.utils.Language.superGetter(org.apache.flex.flat.DropDownList, this, 'className'); + }, + /** @this {org.apache.flex.flat.DropDownList} */ + set: function(value) { + org.apache.flex.utils.Language.superSetter(org.apache.flex.flat.DropDownList, this, 'className', value); + if (this.button) { + this.button.className = this.typeNames ? + value + ' ' + 'dropdown-toggle-open-btn' + ' ' + this.typeNames : + value + ' ' + 'dropdown-toggle-open-btn'; + } + } + }, dataProvider: { /** @this {org.apache.flex.flat.DropDownList} */ get: function() {
