Lines Matching full:this
10 this.$el = $($el);
11 this.targets = [];
12 this.on = '';
13 this.className = '';
14 this.self = false;
16 if(this.$el.length) {
18 this.init();
24 this.$el = $($el);
25 this.targets = [];
26 this.on = '';
27 this.className = '';
28 this.self = false;
30 if(this.$el.length) {
32 this.init();
38 var scope = this;
41 this.setup();
44 this.$el.on(this.on, function(e) {
61 this.targets = this.parseTargets();
62 this.on = Gumby.selectAttr.apply(this.$el, ['on']) || Gumby.click;
63 this.className = Gumby.selectAttr.apply(this.$el, ['classname']) || 'active';
64 this.self = Gumby.selectAttr.apply(this.$el, ['self']) === 'false';
69 var targetStr = Gumby.selectAttr.apply(this.$el, ['trigger']),
82 if(!this.checkTargets([targetStr])) {
90 if(!this.checkTargets(targets)) {
101 Gumby.error('Cannot find '+this.constructor.name+' target: '+targets[i]);
112 Gumby.debug('Triggering onTrigger event', this.$el);
113 this.$el.trigger('gumby.onTrigger', [this.$el.hasClass(this.className)]);
123 Gumby.debug('Triggering Toggle', this.$el);
128 if(!this.targets) {
129 this.$el.toggleClass(this.className);
132 } else if(this.targets.length == 1) {
133 this.$el.add(this.targets[0]).toggleClass(this.className);
137 } else if(this.targets.length > 1) {
138 if(this.targets[0].hasClass(this.className)) {
139 $target = this.targets[0];
141 // add this element to it unless gumby-self set
142 if(!this.self) {
143 $target = $target.add(this.$el);
146 $target.removeClass(this.className);
147 this.targets[1].addClass(this.className);
149 $target = this.targets[0];
151 // add this element to it unless gumby-self set
152 if(!this.self) {
153 $target = $target.add(this.$el);
156 $target.addClass(this.className);
157 this.targets[1].removeClass(this.className);
163 cb.apply(this);
170 Gumby.debug('Triggering Switch', this.$el);
175 if(!this.targets) {
176 this.$el.addClass(this.className);
179 } else if(this.targets.length == 1) {
180 $target = this.targets[0];
182 // add this element to it unless gumby-self set
183 if(!this.self) {
184 $target = $target.add(this.$el);
187 $target.addClass(this.className);
191 } else if(this.targets.length > 1) {
192 $target = this.targets[0];
194 // add this element to it unless gumby-self set
195 if(!this.self) {
196 $target = $target.add(this.$el);
199 $target.addClass(this.className);
200 this.targets[1].removeClass(this.className);
205 cb.apply(this);
212 var $this = $(this);
214 // this element has already been initialized
216 if($this.data('isToggle') && !all) {
219 // this element has already been initialized
221 } else if($this.data('isToggle') && all) {
222 $this.trigger('gumby.initialize');
226 $this.data('isToggle', true);
227 new Toggle($this);
234 var $this = $(this);
236 // this element has already been initialized
238 if($this.data('isSwitch') && !all) {
241 // this element has already been initialized
243 } else if($this.data('isSwitch') && all) {
244 $this.trigger('gumby.initialize');
249 $this.data('isSwitch', true);
250 new Switch($this);