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 ) {
0 commit comments