diff --git a/README.md b/README.md index 08dda80..0ca858b 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ It's possible to use multiple DropdownDivConverter widgets on the same page. Tha Since the dropdown menu is based on bootstraps dropdown button it is recommended to follow the applications Bootstrap theming rules with respect to buttons. ## Release Notes +Appstore 1.4 release: +- added self closing behaviour support for clickable listview (listviews with a microflow 'on click' property). + Appstore 1.3 release: - added bootstrap glyphicon icon support: just add the "glyphicon-" classname to the settings. diff --git a/src/DropdownDivConverter/widget/DropdownDivConverter.js b/src/DropdownDivConverter/widget/DropdownDivConverter.js index 9c27999..d1d9bfd 100644 --- a/src/DropdownDivConverter/widget/DropdownDivConverter.js +++ b/src/DropdownDivConverter/widget/DropdownDivConverter.js @@ -6,7 +6,7 @@ ======================== @file : DropdownDivConverter.js - @version : 1.0 + @version : 1.4 @author : Willem Gorisse @date : Wed, 24 Jun 2015 15:15:32 GMT @copyright : 2015 Mendix @@ -155,7 +155,7 @@ define([ // Mendix buttons and links stop events from bubbling: set actions for internal button clicks to close the menu if needed if (this.autoClose){ - var internalButtons = domQuery("button, a",this.dropdownMenu); + var internalButtons = domQuery("button, a", this.dropdownMenu); dojoArray.forEach(internalButtons, lang.hitch(this,function(node, i){ this.connect(node, "click", lang.hitch(this, function(e) { if (this._isOpen){ @@ -163,6 +163,19 @@ define([ } })); })); + // add logic to deal with listviews as they stop events from 6+ + var internalListviews = domQuery(".mx-listview-clickable .mx-list", this.dropdownMenu); + dojoArray.forEach(internalListviews, lang.hitch(this,function(listNode, i){ + var listItemClick = lang.hitch(this,function(e) { + if (this._isOpen){ + this._toggleMenu(); + }}); + listNode.addEventListener('click', listItemClick,true); + // manually remove the eventlistener on destroy + this.addOnDestroy(function(){ + listNode.removeEventListener('click', listItemClick, true) + }); + })); } // set the action for the possible split group button diff --git a/src/package.xml b/src/package.xml index 0fe7735..6a0893a 100644 --- a/src/package.xml +++ b/src/package.xml @@ -1,6 +1,6 @@ - + diff --git a/test/Test.mpr b/test/Test.mpr index 49912ad..c0576b2 100644 Binary files a/test/Test.mpr and b/test/Test.mpr differ diff --git a/test/widgets/DropdownDivConverter.mpk b/test/widgets/DropdownDivConverter.mpk index 87fb983..d0a1bff 100644 Binary files a/test/widgets/DropdownDivConverter.mpk and b/test/widgets/DropdownDivConverter.mpk differ