2 * Copyright (c) 2012, Intel Corporation.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 (function($, undefined) {
13 var ChScrollable = function(element, options) {
14 $.fn.ch_widget.Constructor(element, options);
15 this.$element = $(element);
16 this.options = $.extend(
18 $.fn.ch_widget.defaults,
23 ChScrollable.prototype = $.extend(
25 $.fn.ch_widget.Constructor.prototype,
27 constructor: ChScrollable,
30 this.$element.mCustomScrollbar({
39 $.fn.ch_scrollable = function(option) {
40 return this.each(function() {
42 data = $this.data('ch_scrollable'),
43 options = typeof option == 'object' && option;
46 $this.data('ch_scrollable', (data = new ChScrollable(this, options)));
50 if(typeof option == 'string')
55 $.fn.ch_page.Constructor = ChScrollable;
57 /* CHSCROLLABLE DATA-API
58 * ================= */
60 $('div.ch-scrollable').ch_scrollable('enable');