Skip to content

Commit

Permalink
Disable Chosen.js for the rule field, again (#12877)
Browse files Browse the repository at this point in the history
* Revert the check for instance type of data-chosen, to allow to disable Chosen for field with data-chosen="true"

* Add some explanation
  • Loading branch information
Fedik authored and rdeutz committed Dec 10, 2016
1 parent 375897a commit f621f08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions media/jui/js/chosen.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2016 Harvest http://getharvest.com
Modified for Joomla! UI:
- revert the check for instance type of data-chosen, to allow to disable Chosen for field with data-chosen="true", @see https://github.com/joomla/joomla-cms/pull/12877
- rename the css and javascript classes and functions to revert back to using chzn and liszt
- fix zero width, based on https://github.com/harvesthq/chosen/pull/1439
- allow to add a custom value on fly, based on https://github.com/harvesthq/chosen/pull/749
Expand Down Expand Up @@ -593,9 +594,21 @@ This file is generated by `grunt build`, do not edit it by hand.
}
return;
}
/*<JUI>*/
/*
This changes allow to prevent Chosen.js initialization for <select> field by adding data-chosen="true" to this tag,
we need it because in a lot layouts Joomla! applies Chosen.js to all <select> on the page.
@see https://github.com/joomla/joomla-cms/pull/12877
*/
/* Original:
if (!(chosen instanceof Chosen)) {
$this.data('chosen', new Chosen(this, options));
}
*/
if (!chosen) {
$this.data('chosen', new Chosen(this, options));
}
/*</JUI>*/
});
}
});
Expand Down
Loading

0 comments on commit f621f08

Please sign in to comment.