Commit 9008457a authored by Alfredo Sumaran's avatar Alfredo Sumaran

Save instance and avoid multiple instantiation

parent b96d049e
...@@ -117,7 +117,7 @@ class GitLabDropdown ...@@ -117,7 +117,7 @@ class GitLabDropdown
@parseData @fullData @parseData @fullData
} }
# Init filiterable # Init filterable
if @options.filterable if @options.filterable
@filter = new GitLabDropdownFilter @dropdown, @filter = new GitLabDropdownFilter @dropdown,
filterInputBlur: @filterInputBlur filterInputBlur: @filterInputBlur
...@@ -327,4 +327,6 @@ class GitLabDropdown ...@@ -327,4 +327,6 @@ class GitLabDropdown
$.fn.glDropdown = (opts) -> $.fn.glDropdown = (opts) ->
return @.each -> return @.each ->
new GitLabDropdown @, opts if (!$.data @, 'glDropdown')
$.data(@, 'glDropdown', new GitLabDropdown @, opts)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment