Use @ shortcut for constructor arguments
This commit is contained in:
parent
ada808db43
commit
8922e6e854
|
@ -11,7 +11,8 @@
|
|||
/*
|
||||
Chosen source: generate output using 'cake build'
|
||||
Copyright (c) 2011 by Harvest
|
||||
*/ var $, Chosen, get_side_border_padding, root;
|
||||
*/
|
||||
var $, Chosen, get_side_border_padding, root;
|
||||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
root = this;
|
||||
$ = jQuery;
|
||||
|
@ -28,13 +29,10 @@
|
|||
}
|
||||
});
|
||||
Chosen = (function() {
|
||||
function Chosen(elmn, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
this.options = options;
|
||||
function Chosen(form_field, options) {
|
||||
this.form_field = form_field;
|
||||
this.options = options != null ? options : {};
|
||||
this.set_default_values();
|
||||
this.form_field = elmn;
|
||||
this.form_field_jq = $(this.form_field);
|
||||
this.is_multiple = this.form_field.multiple;
|
||||
this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
|
||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -11,17 +11,15 @@
|
|||
/*
|
||||
Chosen source: generate output using 'cake build'
|
||||
Copyright (c) 2011 by Harvest
|
||||
*/ var Chosen, get_side_border_padding, root;
|
||||
*/
|
||||
var Chosen, get_side_border_padding, root;
|
||||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
root = this;
|
||||
Chosen = (function() {
|
||||
function Chosen(elmn, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
this.options = options;
|
||||
function Chosen(form_field, options) {
|
||||
this.form_field = form_field;
|
||||
this.options = options != null ? options : {};
|
||||
this.set_default_values();
|
||||
this.form_field = elmn;
|
||||
this.is_multiple = this.form_field.multiple;
|
||||
this.is_rtl = this.form_field.hasClassName("chzn-rtl");
|
||||
this.default_text_default = this.form_field.multiple ? "Select Some Options" : "Select an Option";
|
||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -15,11 +15,9 @@ $.fn.extend({
|
|||
|
||||
class Chosen
|
||||
|
||||
constructor: (elmn, options={}) ->
|
||||
@options = options
|
||||
constructor: (@form_field, @options={}) ->
|
||||
this.set_default_values()
|
||||
|
||||
@form_field = elmn
|
||||
@form_field_jq = $ @form_field
|
||||
@is_multiple = @form_field.multiple
|
||||
@is_rtl = @form_field_jq.hasClass "chzn-rtl"
|
||||
|
|
|
@ -6,12 +6,10 @@ root = this
|
|||
|
||||
class Chosen
|
||||
|
||||
constructor: (elmn, options={}) ->
|
||||
@options = options
|
||||
constructor: (@form_field, @options={}) ->
|
||||
|
||||
this.set_default_values()
|
||||
|
||||
@form_field = elmn
|
||||
@is_multiple = @form_field.multiple
|
||||
@is_rtl = @form_field.hasClassName "chzn-rtl"
|
||||
|
||||
|
|
Loading…
Reference in a new issue