Skip to content

Commit 9061ebb

Browse files
fixed dynamic button label bug, added link renderer, smaller requests
1 parent c48e6e6 commit 9061ebb

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ Since the dropdown menu is based on bootstraps dropdown button it is recommended
3535

3636
## Release Notes
3737
Appstore 1.5 release:
38-
- updated closing behaviour to be compatible with other similar custom widget closing constructions
39-
- added closing behaviour to split button click
40-
- updated to enable Mx 6.10+ compatibility
41-
- updated to support nesting a dropdown in a dropdown (note: set the outer one to non self-closing)
38+
- added dynamic titles.
39+
- updated closing behaviour to be compatible with other similar custom widget closing constructions.
40+
- added closing behaviour to split button click.
41+
- updated to enable Mx 6.10+ compatibility.
42+
- updated to support nesting a dropdown in a dropdown (note: set the outer one to non self-closing).
43+
- added the bootstrap link button variant.
4244
- updated the testproject to higher version. Note that this release will therefore not be tested on 5.14.1 anymore.
4345

4446
Appstore 1.4 release:

src/DropdownDivConverter/widget/DropdownDivConverter.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
========================
77
88
@file : DropdownDivConverter.js
9-
@version : 1.4
9+
@version : 1.5
1010
@author : Willem Gorisse
11-
@date : Wed, 24 Jun 2015 15:15:32 GMT
11+
@date : Wed, 4 Jul 2017 15:15:32 GMT
1212
@copyright : 2015 Mendix
1313
@license : Apache Licence 2.0
1414
@@ -66,10 +66,9 @@ define([
6666
this._contextObj = obj;
6767

6868
// preset the label
69-
this._buttonLabel = this.buttonTitle;
69+
7070
if (this.dynamicButtonTitleAttribute !== "" && this._contextObj !== null) {
7171
this._dynamicLabel = true;
72-
this._buttonLabel = this._contextObj.get(this.dynamicButtonTitleAttribute);
7372
}
7473

7574
this._resetSubscriptions();
@@ -90,6 +89,7 @@ define([
9089

9190
// Really render the interface, if renderAsOpen is true: render the menu in open state
9291
_renderInterface: function(renderAsOpen, callback) {
92+
this._updateButtonTitle();
9393
this.dropdownButton.innerHTML = this._buttonLabel + "<span class='caret'></span>";
9494
// if a glyphicon icon was requested and the splitButton is not wanted: add the glyphicon to the button.
9595
if (this.buttonGlyphicon !== "" && !this.splitButtonActive){
@@ -287,6 +287,19 @@ define([
287287
// adjust the dropdownButtons content
288288
this.dropdownButton.innerHTML = "<span class='caret'></span><span class='sr-only'>Toggle Dropdown</span";
289289
},
290+
291+
// update the dynamic button title
292+
_updateButtonTitle: function() {
293+
this._buttonLabel = this.buttonTitle;
294+
if (this._dynamicLabel) {
295+
this._buttonLabel = this._contextObj.get(this.dynamicButtonTitleAttribute);
296+
}
297+
298+
//if (this.dynamicButtonTitleAttribute !== "" && this._contextObj !== null) {
299+
// this._dynamicLabel = true;
300+
// this._buttonLabel = this._contextObj.get(this.dynamicButtonTitleAttribute);
301+
//}
302+
},
290303

291304
// Add a glyphicon to a button
292305
_addGlyphicon: function(buttonObject) {

test/Test.mpr

0 Bytes
Binary file not shown.
-62 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)