mtl 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mtl/dropdown.coffee +1 -1
  3. data/app/assets/stylesheets/mtl/extend/_chips.scss +20 -0
  4. data/app/assets/stylesheets/mtl/extend/_side-nav.scss +4 -2
  5. data/lib/generators/mtl/templates/_variables.scss +5 -0
  6. data/lib/mtl/version.rb +2 -2
  7. data/mtl.gemspec +11 -0
  8. data/package.json +1 -1
  9. data/vendor/assets/javascripts/materialize/animation.js +8 -9
  10. data/vendor/assets/javascripts/materialize/carousel.js +51 -24
  11. data/vendor/assets/javascripts/materialize/character_counter.js +2 -2
  12. data/vendor/assets/javascripts/materialize/chips.js +40 -11
  13. data/vendor/assets/javascripts/materialize/dropdown.js +12 -12
  14. data/vendor/assets/javascripts/materialize/forms.js +131 -35
  15. data/vendor/assets/javascripts/materialize/global.js +55 -0
  16. data/vendor/assets/javascripts/materialize/init.js +40 -3
  17. data/vendor/assets/javascripts/materialize/materialbox.js +93 -77
  18. data/vendor/assets/javascripts/materialize/modal.js +12 -12
  19. data/vendor/assets/javascripts/materialize/parallax.js +48 -48
  20. data/vendor/assets/javascripts/materialize/scrollFire.js +40 -37
  21. data/vendor/assets/javascripts/materialize/scrollspy.js +2 -53
  22. data/vendor/assets/javascripts/materialize/sideNav.js +46 -40
  23. data/vendor/assets/javascripts/materialize/slider.js +15 -12
  24. data/vendor/assets/javascripts/materialize/tabs.js +104 -35
  25. data/vendor/assets/javascripts/materialize/toasts.js +122 -123
  26. data/vendor/assets/javascripts/materialize/tooltip.js +15 -13
  27. data/vendor/assets/javascripts/materialize/transitions.js +24 -24
  28. data/vendor/assets/stylesheets/materialize/_badges.scss +46 -0
  29. data/vendor/assets/stylesheets/materialize/_buttons.scss +29 -17
  30. data/vendor/assets/stylesheets/materialize/_cards.scss +9 -3
  31. data/vendor/assets/stylesheets/materialize/_carousel.scss +1 -1
  32. data/vendor/assets/stylesheets/materialize/_collapsible.scss +3 -7
  33. data/vendor/assets/stylesheets/materialize/_global.scss +5 -61
  34. data/vendor/assets/stylesheets/materialize/_materialbox.scss +13 -12
  35. data/vendor/assets/stylesheets/materialize/_navbar.scss +26 -7
  36. data/vendor/assets/stylesheets/materialize/_sideNav.scss +5 -5
  37. data/vendor/assets/stylesheets/materialize/_table_of_contents.scss +2 -2
  38. data/vendor/assets/stylesheets/materialize/_toast.scss +1 -1
  39. data/vendor/assets/stylesheets/materialize/_tooltip.scss +2 -3
  40. data/vendor/assets/stylesheets/materialize/_transitions.scss +13 -0
  41. data/vendor/assets/stylesheets/materialize/_variables.scss +7 -1
  42. data/vendor/assets/stylesheets/materialize/_waves.scss +80 -143
  43. data/vendor/assets/stylesheets/materialize/forms/_input-fields.scss +4 -4
  44. metadata +9 -4
@@ -1,58 +1,58 @@
1
1
  (function ($) {
2
2
 
3
- $.fn.parallax = function () {
4
- var window_width = $(window).width();
5
- // Parallax Scripts
6
- return this.each(function(i) {
7
- var $this = $(this);
8
- $this.addClass('parallax');
9
-
10
- function updateParallax(initial) {
11
- var container_height;
12
- if (window_width < 601) {
13
- container_height = ($this.height() > 0) ? $this.height() : $this.children("img").height();
14
- }
15
- else {
16
- container_height = ($this.height() > 0) ? $this.height() : 500;
17
- }
18
- var $img = $this.children("img").first();
19
- var img_height = $img.height();
20
- var parallax_dist = img_height - container_height;
21
- var bottom = $this.offset().top + container_height;
22
- var top = $this.offset().top;
23
- var scrollTop = $(window).scrollTop();
24
- var windowHeight = window.innerHeight;
25
- var windowBottom = scrollTop + windowHeight;
26
- var percentScrolled = (windowBottom - top) / (container_height + windowHeight);
27
- var parallax = Math.round((parallax_dist * percentScrolled));
28
-
29
- if (initial) {
30
- $img.css('display', 'block');
31
- }
32
- if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {
33
- $img.css('transform', "translate3D(-50%," + parallax + "px, 0)");
34
- }
35
-
3
+ $.fn.parallax = function () {
4
+ var window_width = $(window).width();
5
+ // Parallax Scripts
6
+ return this.each(function(i) {
7
+ var $this = $(this);
8
+ $this.addClass('parallax');
9
+
10
+ function updateParallax(initial) {
11
+ var container_height;
12
+ if (window_width < 601) {
13
+ container_height = ($this.height() > 0) ? $this.height() : $this.children("img").height();
14
+ }
15
+ else {
16
+ container_height = ($this.height() > 0) ? $this.height() : 500;
17
+ }
18
+ var $img = $this.children("img").first();
19
+ var img_height = $img.height();
20
+ var parallax_dist = img_height - container_height;
21
+ var bottom = $this.offset().top + container_height;
22
+ var top = $this.offset().top;
23
+ var scrollTop = $(window).scrollTop();
24
+ var windowHeight = window.innerHeight;
25
+ var windowBottom = scrollTop + windowHeight;
26
+ var percentScrolled = (windowBottom - top) / (container_height + windowHeight);
27
+ var parallax = Math.round((parallax_dist * percentScrolled));
28
+
29
+ if (initial) {
30
+ $img.css('display', 'block');
31
+ }
32
+ if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {
33
+ $img.css('transform', "translate3D(-50%," + parallax + "px, 0)");
36
34
  }
37
35
 
38
- // Wait for image load
39
- $this.children("img").one("load", function() {
40
- updateParallax(true);
41
- }).each(function() {
42
- if (this.complete) $(this).trigger("load");
43
- });
36
+ }
44
37
 
45
- $(window).scroll(function() {
46
- window_width = $(window).width();
47
- updateParallax(false);
48
- });
38
+ // Wait for image load
39
+ $this.children("img").one("load", function() {
40
+ updateParallax(true);
41
+ }).each(function() {
42
+ if (this.complete) $(this).trigger("load");
43
+ });
49
44
 
50
- $(window).resize(function() {
51
- window_width = $(window).width();
52
- updateParallax(false);
53
- });
45
+ $(window).scroll(function() {
46
+ window_width = $(window).width();
47
+ updateParallax(false);
48
+ });
54
49
 
50
+ $(window).resize(function() {
51
+ window_width = $(window).width();
52
+ updateParallax(false);
55
53
  });
56
54
 
57
- };
55
+ });
56
+
57
+ };
58
58
  }( jQuery ));
@@ -1,48 +1,51 @@
1
1
  (function($) {
2
2
 
3
- // Input: Array of JSON objects {selector, offset, callback}
3
+ var scrollFireEventsHandled = false;
4
4
 
5
+ // Input: Array of JSON objects {selector, offset, callback}
5
6
  Materialize.scrollFire = function(options) {
6
-
7
- var didScroll = false;
8
-
9
- window.addEventListener("scroll", function() {
10
- didScroll = true;
11
- });
12
-
13
- // Rate limit to 100ms
14
- setInterval(function() {
15
- if(didScroll) {
16
- didScroll = false;
17
-
18
- var windowScroll = window.pageYOffset + window.innerHeight;
19
-
20
- for (var i = 0 ; i < options.length; i++) {
21
- // Get options from each line
22
- var value = options[i];
23
- var selector = value.selector,
24
- offset = value.offset,
25
- callback = value.callback;
26
-
27
- var currentElement = document.querySelector(selector);
28
- if ( currentElement !== null) {
29
- var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;
30
-
31
- if (windowScroll > (elementOffset + offset)) {
32
- if (value.done !== true) {
33
- if (typeof(callback) === 'function') {
34
- callback.call(this, currentElement);
35
- } else if (typeof(callback) === 'string') {
36
- var callbackFunc = new Function(callback);
37
- callbackFunc(currentElement);
38
- }
39
- value.done = true;
40
- }
7
+ var onScroll = function() {
8
+ var windowScroll = window.pageYOffset + window.innerHeight;
9
+
10
+ for (var i = 0 ; i < options.length; i++) {
11
+ // Get options from each line
12
+ var value = options[i];
13
+ var selector = value.selector,
14
+ offset = value.offset,
15
+ callback = value.callback;
16
+
17
+ var currentElement = document.querySelector(selector);
18
+ if ( currentElement !== null) {
19
+ var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;
20
+
21
+ if (windowScroll > (elementOffset + offset)) {
22
+ if (value.done !== true) {
23
+ if (typeof(callback) === 'function') {
24
+ callback.call(this, currentElement);
25
+ } else if (typeof(callback) === 'string') {
26
+ var callbackFunc = new Function(callback);
27
+ callbackFunc(currentElement);
41
28
  }
29
+ value.done = true;
42
30
  }
43
31
  }
32
+ }
44
33
  }
45
- }, 100);
34
+ };
35
+
36
+
37
+ var throttledScroll = Materialize.throttle(function() {
38
+ onScroll();
39
+ }, options.throttle || 100);
40
+
41
+ if (!scrollFireEventsHandled) {
42
+ window.addEventListener("scroll", throttledScroll);
43
+ window.addEventListener("resize", throttledScroll);
44
+ scrollFireEventsHandled = true;
45
+ }
46
+
47
+ // perform a scan once, after current execution context, and after dom is ready
48
+ setTimeout(throttledScroll, 0);
46
49
  };
47
50
 
48
51
  })(jQuery);
@@ -105,57 +105,6 @@
105
105
  jWindow.trigger('scrollSpy:winSize');
106
106
  }
107
107
 
108
- /**
109
- * Get time in ms
110
- * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
111
- * @type {function}
112
- * @return {number}
113
- */
114
- var getTime = (Date.now || function () {
115
- return new Date().getTime();
116
- });
117
-
118
- /**
119
- * Returns a function, that, when invoked, will only be triggered at most once
120
- * during a given window of time. Normally, the throttled function will run
121
- * as much as it can, without ever going more than once per `wait` duration;
122
- * but if you'd like to disable the execution on the leading edge, pass
123
- * `{leading: false}`. To disable execution on the trailing edge, ditto.
124
- * @license https://raw.github.com/jashkenas/underscore/master/LICENSE
125
- * @param {function} func
126
- * @param {number} wait
127
- * @param {Object=} options
128
- * @returns {Function}
129
- */
130
- function throttle(func, wait, options) {
131
- var context, args, result;
132
- var timeout = null;
133
- var previous = 0;
134
- options || (options = {});
135
- var later = function () {
136
- previous = options.leading === false ? 0 : getTime();
137
- timeout = null;
138
- result = func.apply(context, args);
139
- context = args = null;
140
- };
141
- return function () {
142
- var now = getTime();
143
- if (!previous && options.leading === false) previous = now;
144
- var remaining = wait - (now - previous);
145
- context = this;
146
- args = arguments;
147
- if (remaining <= 0) {
148
- clearTimeout(timeout);
149
- timeout = null;
150
- previous = now;
151
- result = func.apply(context, args);
152
- context = args = null;
153
- } else if (!timeout && options.trailing !== false) {
154
- timeout = setTimeout(later, remaining);
155
- }
156
- return result;
157
- };
158
- };
159
108
 
160
109
  /**
161
110
  * Enables ScrollSpy using a selector
@@ -193,7 +142,7 @@
193
142
  offset.bottom = options.offsetBottom || 0;
194
143
  offset.left = options.offsetLeft || 0;
195
144
 
196
- var throttledScroll = throttle(function() {
145
+ var throttledScroll = Materialize.throttle(function() {
197
146
  onScroll(options.scrollOffset);
198
147
  }, options.throttle || 100);
199
148
  var readyScroll = function(){
@@ -263,7 +212,7 @@
263
212
  options = options || {
264
213
  throttle: 100
265
214
  };
266
- return jWindow.on('resize', throttle(onWinSize, options.throttle || 100));
215
+ return jWindow.on('resize', Materialize.throttle(onWinSize, options.throttle || 100));
267
216
  };
268
217
 
269
218
  /**
@@ -12,41 +12,47 @@
12
12
 
13
13
  $(this).each(function(){
14
14
  var $this = $(this);
15
- var menu_id = $("#"+ $this.attr('data-activates'));
15
+ var menuId = $this.attr('data-activates');
16
+ var menu = $("#"+ menuId);
16
17
 
17
18
  // Set to width
18
19
  if (options.menuWidth != 300) {
19
- menu_id.css('width', options.menuWidth);
20
+ menu.css('width', options.menuWidth);
20
21
  }
21
22
 
22
23
  // Add Touch Area
23
- var $dragTarget;
24
+ var $dragTarget = $('.drag-target[data-sidenav="' + menuId + '"]');
24
25
  if (options.draggable) {
25
- $dragTarget = $('<div class="drag-target"></div>').attr('data-sidenav', $this.attr('data-activates'));
26
+ // Regenerate dragTarget
27
+ if ($dragTarget.length) {
28
+ $dragTarget.remove();
29
+ }
30
+
31
+ $dragTarget = $('<div class="drag-target"></div>').attr('data-sidenav', menuId);
26
32
  $('body').append($dragTarget);
27
33
  } else {
28
34
  $dragTarget = $();
29
35
  }
30
36
 
31
37
  if (options.edge == 'left') {
32
- menu_id.css('transform', 'translateX(-100%)');
38
+ menu.css('transform', 'translateX(-100%)');
33
39
  $dragTarget.css({'left': 0}); // Add Touch Area
34
40
  }
35
41
  else {
36
- menu_id.addClass('right-aligned') // Change text-alignment to right
42
+ menu.addClass('right-aligned') // Change text-alignment to right
37
43
  .css('transform', 'translateX(100%)');
38
44
  $dragTarget.css({'right': 0}); // Add Touch Area
39
45
  }
40
46
 
41
47
  // If fixed sidenav, bring menu out
42
- if (menu_id.hasClass('fixed')) {
48
+ if (menu.hasClass('fixed')) {
43
49
  if (window.innerWidth > 992) {
44
- menu_id.css('transform', 'translateX(0)');
50
+ menu.css('transform', 'translateX(0)');
45
51
  }
46
52
  }
47
53
 
48
54
  // Window resize to reset on large screens fixed
49
- if (menu_id.hasClass('fixed')) {
55
+ if (menu.hasClass('fixed')) {
50
56
  $(window).resize( function() {
51
57
  if (window.innerWidth > 992) {
52
58
  // Close menu if window is resized bigger than 992 and user has fixed sidenav
@@ -54,16 +60,16 @@
54
60
  removeMenu(true);
55
61
  }
56
62
  else {
57
- // menu_id.removeAttr('style');
58
- menu_id.css('transform', 'translateX(0%)');
59
- // menu_id.css('width', options.menuWidth);
63
+ // menu.removeAttr('style');
64
+ menu.css('transform', 'translateX(0%)');
65
+ // menu.css('width', options.menuWidth);
60
66
  }
61
67
  }
62
68
  else if (menuOut === false){
63
69
  if (options.edge === 'left') {
64
- menu_id.css('transform', 'translateX(-100%)');
70
+ menu.css('transform', 'translateX(-100%)');
65
71
  } else {
66
- menu_id.css('transform', 'translateX(100%)');
72
+ menu.css('transform', 'translateX(100%)');
67
73
  }
68
74
 
69
75
  }
@@ -73,7 +79,7 @@
73
79
 
74
80
  // if closeOnClick, then add close event for all a tags in side sideNav
75
81
  if (options.closeOnClick === true) {
76
- menu_id.on("click.itemclick", "a:not(.collapsible-header)", function(){
82
+ menu.on("click.itemclick", "a:not(.collapsible-header)", function(){
77
83
  removeMenu();
78
84
  });
79
85
  }
@@ -95,7 +101,7 @@
95
101
  if (options.edge === 'left') {
96
102
  // Reset phantom div
97
103
  $dragTarget.css({width: '', right: '', left: '0'});
98
- menu_id.velocity(
104
+ menu.velocity(
99
105
  {'translateX': '-100%'},
100
106
  { duration: 200,
101
107
  queue: false,
@@ -103,8 +109,8 @@
103
109
  complete: function() {
104
110
  if (restoreNav === true) {
105
111
  // Restore Fixed sidenav
106
- menu_id.removeAttr('style');
107
- menu_id.css('width', options.menuWidth);
112
+ menu.removeAttr('style');
113
+ menu.css('width', options.menuWidth);
108
114
  }
109
115
  }
110
116
 
@@ -113,7 +119,7 @@
113
119
  else {
114
120
  // Reset phantom div
115
121
  $dragTarget.css({width: '', right: '0', left: ''});
116
- menu_id.velocity(
122
+ menu.velocity(
117
123
  {'translateX': '100%'},
118
124
  { duration: 200,
119
125
  queue: false,
@@ -121,8 +127,8 @@
121
127
  complete: function() {
122
128
  if (restoreNav === true) {
123
129
  // Restore Fixed sidenav
124
- menu_id.removeAttr('style');
125
- menu_id.css('width', options.menuWidth);
130
+ menu.removeAttr('style');
131
+ menu.css('width', options.menuWidth);
126
132
  }
127
133
  }
128
134
  });
@@ -180,7 +186,7 @@
180
186
  if (x < (options.menuWidth / 2)) { menuOut = false; }
181
187
  // Right Direction
182
188
  else if (x >= (options.menuWidth / 2)) { menuOut = true; }
183
- menu_id.css('transform', 'translateX(' + (x - options.menuWidth) + 'px)');
189
+ menu.css('transform', 'translateX(' + (x - options.menuWidth) + 'px)');
184
190
  }
185
191
  else {
186
192
  // Left Direction
@@ -196,7 +202,7 @@
196
202
  rightPos = 0;
197
203
  }
198
204
 
199
- menu_id.css('transform', 'translateX(' + rightPos + 'px)');
205
+ menu.css('transform', 'translateX(' + rightPos + 'px)');
200
206
  }
201
207
 
202
208
 
@@ -233,7 +239,7 @@
233
239
  if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
234
240
  // Return menu to open
235
241
  if (leftPos !== 0) {
236
- menu_id.velocity({'translateX': [0, leftPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
242
+ menu.velocity({'translateX': [0, leftPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
237
243
  }
238
244
 
239
245
  $overlay.velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
@@ -247,7 +253,7 @@
247
253
  width: ''
248
254
  });
249
255
  // Slide menu closed
250
- menu_id.velocity({'translateX': [-1 * options.menuWidth - 10, leftPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
256
+ menu.velocity({'translateX': [-1 * options.menuWidth - 10, leftPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
251
257
  $overlay.velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
252
258
  complete: function () {
253
259
  $(this).remove();
@@ -259,7 +265,7 @@
259
265
  if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
260
266
  // Return menu to open
261
267
  if (rightPos !== 0) {
262
- menu_id.velocity({'translateX': [0, rightPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
268
+ menu.velocity({'translateX': [0, rightPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
263
269
  }
264
270
 
265
271
  $overlay.velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
@@ -274,7 +280,7 @@
274
280
  });
275
281
 
276
282
  // Slide menu closed
277
- menu_id.velocity({'translateX': [options.menuWidth + 10, rightPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
283
+ menu.velocity({'translateX': [options.menuWidth + 10, rightPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
278
284
  $overlay.velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
279
285
  complete: function () {
280
286
  $(this).remove();
@@ -287,7 +293,7 @@
287
293
  });
288
294
  }
289
295
 
290
- $this.click(function() {
296
+ $this.off('click.sidenav').on('click.sidenav', function() {
291
297
  if (menuOut === true) {
292
298
  menuOut = false;
293
299
  panning = false;
@@ -307,11 +313,11 @@
307
313
 
308
314
  if (options.edge === 'left') {
309
315
  $dragTarget.css({width: '50%', right: 0, left: ''});
310
- menu_id.velocity({'translateX': [0, -1 * options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
316
+ menu.velocity({'translateX': [0, -1 * options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
311
317
  }
312
318
  else {
313
319
  $dragTarget.css({width: '50%', right: '', left: 0});
314
- menu_id.velocity({'translateX': [0, options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
320
+ menu.velocity({'translateX': [0, options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
315
321
  }
316
322
 
317
323
  $overlay.css('opacity', 0)
@@ -357,14 +363,14 @@
357
363
  };
358
364
 
359
365
 
360
- $.fn.sideNav = function(methodOrOptions) {
361
- if ( methods[methodOrOptions] ) {
362
- return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
363
- } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
364
- // Default to "init"
365
- return methods.init.apply( this, arguments );
366
- } else {
367
- $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.sideNav' );
368
- }
369
- }; // Plugin end
366
+ $.fn.sideNav = function(methodOrOptions) {
367
+ if ( methods[methodOrOptions] ) {
368
+ return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
369
+ } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
370
+ // Default to "init"
371
+ return methods.init.apply( this, arguments );
372
+ } else {
373
+ $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.sideNav' );
374
+ }
375
+ }; // Plugin end
370
376
  }( jQuery ));
@@ -180,10 +180,13 @@
180
180
  var direction = e.gesture.direction;
181
181
  var x = e.gesture.deltaX;
182
182
  var velocityX = e.gesture.velocityX;
183
+ var velocityY = e.gesture.velocityY;
183
184
 
184
185
  $curr_slide = $slider.find('.active');
185
- $curr_slide.velocity({ translateX: x
186
- }, {duration: 50, queue: false, easing: 'easeOutQuad'});
186
+ if (Math.abs(velocityX) > Math.abs(velocityY)) {
187
+ $curr_slide.velocity({ translateX: x
188
+ }, {duration: 50, queue: false, easing: 'easeOutQuad'});
189
+ }
187
190
 
188
191
  // Swipe Left
189
192
  if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.65)) {
@@ -308,14 +311,14 @@
308
311
  };
309
312
 
310
313
 
311
- $.fn.slider = function(methodOrOptions) {
312
- if ( methods[methodOrOptions] ) {
313
- return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
314
- } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
315
- // Default to "init"
316
- return methods.init.apply( this, arguments );
317
- } else {
318
- $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );
319
- }
320
- }; // Plugin end
314
+ $.fn.slider = function(methodOrOptions) {
315
+ if ( methods[methodOrOptions] ) {
316
+ return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
317
+ } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
318
+ // Default to "init"
319
+ return methods.init.apply( this, arguments );
320
+ } else {
321
+ $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );
322
+ }
323
+ }; // Plugin end
321
324
  }( jQuery ));