Removes copied dependencies, bootstrap unit tests, custom scrollbars.
[profile/ivi/cowhide.git] / src / javascripts / cowhide-select.js
1 /*
2  * Copyright (c) 2012, Intel Corporation.
3  *
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
7  *
8  */
9
10 (function($, undefined) {
11     'use strict';
12
13     var ChSelect = function(element, options) {
14         $.fn.ch_widget.Constructor(element, options);
15         this.$element = $(element);
16         this.options = $.extend(
17             {},
18             $.fn.ch_widget.defaults,
19             {
20                 disableWhenDriving: true
21             });
22     };
23
24     ChSelect.prototype = $.extend(
25         {},
26         $.fn.ch_widget.Constructor.prototype,
27         {
28             constructor: ChSelect
29         }
30     );
31
32     $.fn.ch_select = function(option) {
33         return this.each(function() {
34             var $this = $(this),
35                 data = $this.data('ch_select'),
36                 options = typeof option == 'object' && option;
37
38             if (!data) {
39                 $this.data('ch_select', (data = new ChSelect(this, options)));
40                 data.register();
41             }
42         });
43     };
44
45     $.fn.ch_select.Constructor = ChSelect;
46
47     /* CHBUTTON DATA-API
48      * ================= */
49     $(function() {
50         $('select').ch_select();
51     })
52 })(window.jQuery);