Skip to content

Commit 8e83461

Browse files
authored
Merge pull request #158 from tj-shapeways/make-stopPropagation-optional
Make stop propagation optional
2 parents 47ae37b + 18811dc commit 8e83461

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ $('select').selectric({
212212
*/
213213
inheritOriginalWidth: false,
214214

215+
/*
216+
* Type: Boolean
217+
* Description: call stopProgation on onOpen click event
218+
*/
219+
stopPropagation: true,
220+
215221
/*
216222
* Type: Boolean
217223
* Description: Determine if current selected option should jump to

public/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ <h2>Options</h2>
321321
*/
322322
inheritOriginalWidth: false,
323323

324+
/*
325+
* Type: Boolean
326+
* Description: call stopProgation on onOpen click event
327+
*/
328+
stopPropagation: true,
329+
324330
/*
325331
* Type: Boolean
326332
* Description: Determine if current selected option should jump to

public/jquery.selectric.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric ϟ v1.11.0 (Dec 15 2016) - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric ϟ v1.11.0 (Dec 16 2016) - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
1414
* Copyright (c) 2016 Leonardo Santos; MIT License
1515
*
@@ -831,7 +831,9 @@
831831

832832
if ( e ) {
833833
e.preventDefault();
834-
e.stopPropagation();
834+
if (_this.options.stopPropagation) {
835+
e.stopPropagation();
836+
}
835837
}
836838

837839
if ( _this.state.enabled ) {
@@ -1072,6 +1074,7 @@
10721074
preventWindowScroll : true,
10731075
inheritOriginalWidth : false,
10741076
allowWrap : true,
1077+
stopPropagation : true,
10751078
optionsItemBuilder : '{text}', // function(itemData, element, index)
10761079
labelBuilder : '{text}', // function(currItem)
10771080
listBuilder : false, // function(items)

public/jquery.selectric.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.selectric.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,9 @@
814814

815815
if ( e ) {
816816
e.preventDefault();
817-
e.stopPropagation();
817+
if (_this.options.stopPropagation) {
818+
e.stopPropagation();
819+
}
818820
}
819821

820822
if ( _this.state.enabled ) {
@@ -1055,6 +1057,7 @@
10551057
preventWindowScroll : true,
10561058
inheritOriginalWidth : false,
10571059
allowWrap : true,
1060+
stopPropagation : true,
10581061
optionsItemBuilder : '{text}', // function(itemData, element, index)
10591062
labelBuilder : '{text}', // function(currItem)
10601063
listBuilder : false, // function(items)

0 commit comments

Comments
 (0)