You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to improve the jQuery interface by making it similar to the one most of the jQuery plugins are using?
This would require adding the following 2 properties:
Constructor
noConflict method
My suggestion for the changes is:
JQUERY_INTERFACE = (options) ->
# Do no harm and return as soon as possible for unsupported browsers, namely IE6 and IE7
# Continue on if running IE document type but in compatibility mode
return this unless AbstractChosen.browser_is_supported()
this.each (input_field) ->
$this = $ this
chosen = $this.data('chosen')
if options is 'destroy'
if chosen instanceof Chosen
chosen.destroy()
return
unless chosen instanceof Chosen
$this.data('chosen', new Chosen(this, options))
return
JQUERY_NO_CONFLICT = $.fn["chosen"];
$.fn["chosen"] = JQUERY_INTERFACE;
$.fn["chosen"].Constructor = Chosen;
$.fn["chosen"].AbstractConstructor = AbstractChosen;
$.fn["chosen"].noConflict = () ->
$.fn["chosen"] = JQUERY_NO_CONFLICT;
return jQueryInterface;
I am not a Coffee Script programmer so if you see any issues with the code let me know.
The reason for exposing the Chosen and AbstractChosen is to allow the user to change some of the default settings(like the default strings).
The text was updated successfully, but these errors were encountered:
Hi,
Would it be possible to improve the jQuery interface by making it similar to the one most of the jQuery plugins are using?
This would require adding the following 2 properties:
My suggestion for the changes is:
I am not a Coffee Script programmer so if you see any issues with the code let me know.
The reason for exposing the Chosen and AbstractChosen is to allow the user to change some of the default settings(like the default strings).
The text was updated successfully, but these errors were encountered: