Use @ shortcut for constructor arguments

This commit is contained in:
Nagyman 2011-09-17 05:14:15 -04:00
parent ada808db43
commit 8922e6e854
6 changed files with 14 additions and 22 deletions

View file

@ -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");

File diff suppressed because one or more lines are too long

View file

@ -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";

File diff suppressed because one or more lines are too long

View file

@ -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"

View file

@ -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"