Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion core-dropdown-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@

},


/**
* This specifies the name of the attribute that can be set on
* elements within the dropdown to prevent them from closing the
* dropdown on tap.
*
* @attribute dropdownKeepAttribute
* @type string
* @default 'core-dropdown-keep'
*/
dropdownKeepAttribute: 'core-dropdown-keep',

eventDelegates: {
'tap': 'toggleOverlay'
},
Expand Down Expand Up @@ -107,7 +119,13 @@
this.opened = !!e.detail;
},

toggleOverlay: function() {
toggleOverlay: function(e) {
if (this.opened &&
this.dropdownKeepAttribute &&
e.target && e.target.hasAttribute(this.dropdownKeepAttribute))
{
return;
}
this.opened = !this.opened;
}

Expand Down