material-sass 0.0.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/MaterialIcons-Regular.eot +0 -0
  3. data/app/assets/fonts/MaterialIcons-Regular.ijmap +1 -0
  4. data/app/assets/fonts/MaterialIcons-Regular.ttf +0 -0
  5. data/app/assets/fonts/MaterialIcons-Regular.woff +0 -0
  6. data/app/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
  7. data/app/assets/images/bg/amber.jpg +0 -0
  8. data/app/assets/images/bg/brand.jpg +0 -0
  9. data/app/assets/images/bg/green.jpg +0 -0
  10. data/app/assets/images/bg/purple.jpg +0 -0
  11. data/app/assets/images/bg/red.jpg +0 -0
  12. data/app/assets/images/bg/teal.jpg +0 -0
  13. data/app/assets/javascripts/material.js +664 -507
  14. data/app/assets/javascripts/material.min.js +2 -0
  15. data/app/assets/javascripts/material/_.js +6 -3
  16. data/app/assets/javascripts/material/bootstrap.js +6 -3
  17. data/app/assets/javascripts/material/datepicker.js +95 -64
  18. data/app/assets/javascripts/material/form-adv-label.js +49 -0
  19. data/app/assets/javascripts/material/form-adv-textarea.js +13 -0
  20. data/app/assets/javascripts/material/header.js +12 -56
  21. data/app/assets/javascripts/material/menu.js +188 -38
  22. data/app/assets/javascripts/material/modal.js +10 -8
  23. data/app/assets/javascripts/material/snackbar.js +116 -0
  24. data/app/assets/javascripts/material/tab.js +47 -27
  25. data/app/assets/javascripts/material/tile.js +169 -74
  26. data/app/assets/javascripts/material/wave.js +12 -7
  27. data/app/assets/stylesheets/material.min.css +13 -0
  28. data/app/assets/stylesheets/material/addons/_material-icons.scss +9 -0
  29. data/app/assets/stylesheets/material/addons/_waves.scss +44 -0
  30. data/app/assets/stylesheets/material/{addon/material-design-icon → addons/material-icons}/_core.scss +8 -8
  31. data/app/assets/stylesheets/material/{addon/material-design-icon → addons/material-icons}/_larger.scss +5 -2
  32. data/app/assets/stylesheets/material/addons/material-icons/_path.scss +11 -0
  33. data/app/assets/stylesheets/material/addons/material-icons/_variables.scss +3 -0
  34. data/app/assets/stylesheets/material/base.scss +39 -40
  35. data/app/assets/stylesheets/material/{_grid.scss → base/_grid.scss} +13 -12
  36. data/app/assets/stylesheets/material/{_reset.scss → base/_reset.scss} +160 -161
  37. data/app/assets/stylesheets/material/components/_avatar.scss +94 -0
  38. data/app/assets/stylesheets/material/{element → components}/_breadcrumb.scss +3 -4
  39. data/app/assets/stylesheets/material/components/_button-flat.scss +35 -0
  40. data/app/assets/stylesheets/material/components/_button-float.scss +187 -0
  41. data/app/assets/stylesheets/material/components/_button.scss +86 -0
  42. data/app/assets/stylesheets/material/components/_card.scss +175 -0
  43. data/app/assets/stylesheets/material/{_code.scss → components/_code.scss} +14 -12
  44. data/app/assets/stylesheets/material/components/_dropdown.scss +103 -0
  45. data/app/assets/stylesheets/material/components/_form-adv-checkbox.scss +161 -0
  46. data/app/assets/stylesheets/material/{element → components}/_form-adv-datepicker.scss +87 -108
  47. data/app/assets/stylesheets/material/{element → components}/_form-adv-label.scss +17 -23
  48. data/app/assets/stylesheets/material/components/_form-adv-switch.scss +96 -0
  49. data/app/assets/stylesheets/material/{element → components}/_form-adv-textarea.scss +1 -1
  50. data/app/assets/stylesheets/material/{element → components}/_form.scss +34 -95
  51. data/app/assets/stylesheets/material/components/_label.scss +23 -0
  52. data/app/assets/stylesheets/material/{element → components}/_modal.scss +43 -18
  53. data/app/assets/stylesheets/material/{element → components}/_nav.scss +15 -8
  54. data/app/assets/stylesheets/material/{element → components}/_progress-circular.scss +36 -32
  55. data/app/assets/stylesheets/material/{element → components}/_progress-loadbar.scss +15 -21
  56. data/app/assets/stylesheets/material/{element → components}/_progress.scss +40 -30
  57. data/app/assets/stylesheets/material/components/_snackbar.scss +60 -0
  58. data/app/assets/stylesheets/material/components/_tab.scss +85 -0
  59. data/app/assets/stylesheets/material/components/_table.scss +82 -0
  60. data/app/assets/stylesheets/material/components/_tile.scss +155 -0
  61. data/app/assets/stylesheets/material/elements/_content.scss +42 -0
  62. data/app/assets/stylesheets/material/elements/_footer.scss +10 -0
  63. data/app/assets/stylesheets/material/elements/_header.scss +145 -0
  64. data/app/assets/stylesheets/material/{theme → elements}/_menu.scss +92 -150
  65. data/app/assets/stylesheets/material/mixin/_grid.scss +1 -9
  66. data/app/assets/stylesheets/material/mixin/_responsive.scss +1 -1
  67. data/app/assets/stylesheets/material/mixin/_utilities.scss +1 -1
  68. data/app/assets/stylesheets/material/{_print.scss → utilities/_print.scss} +4 -4
  69. data/app/assets/stylesheets/material/{_utilities-responsive.scss → utilities/_utilities-responsive.scss} +1 -1
  70. data/app/assets/stylesheets/material/{_utilities.scss → utilities/_utilities.scss} +197 -110
  71. data/app/assets/stylesheets/material/var/_colours.scss +336 -0
  72. data/app/assets/stylesheets/material/var/_variables.scss +78 -0
  73. data/lib/material-sass/version.rb +1 -1
  74. metadata +55 -53
  75. data/app/assets/javascripts/material/content.js +0 -46
  76. data/app/assets/javascripts/material/dropdown.js +0 -18
  77. data/app/assets/javascripts/material/esc.js +0 -10
  78. data/app/assets/javascripts/material/footer.js +0 -6
  79. data/app/assets/javascripts/material/form-adv.js +0 -64
  80. data/app/assets/javascripts/material/get-target.js +0 -8
  81. data/app/assets/javascripts/material/toast.js +0 -79
  82. data/app/assets/javascripts/material/webfont.js +0 -47
  83. data/app/assets/javascripts/material/winresize.js +0 -28
  84. data/app/assets/stylesheets/material/_variable.scss +0 -120
  85. data/app/assets/stylesheets/material/addon/_material-design-icon.scss +0 -9
  86. data/app/assets/stylesheets/material/addon/_waves.scss +0 -45
  87. data/app/assets/stylesheets/material/addon/material-design-icon/_path.scss +0 -11
  88. data/app/assets/stylesheets/material/addon/material-design-icon/_variables.scss +0 -3
  89. data/app/assets/stylesheets/material/element/_avatar.scss +0 -67
  90. data/app/assets/stylesheets/material/element/_button-flat.scss +0 -32
  91. data/app/assets/stylesheets/material/element/_button-float.scss +0 -202
  92. data/app/assets/stylesheets/material/element/_button.scss +0 -95
  93. data/app/assets/stylesheets/material/element/_card.scss +0 -245
  94. data/app/assets/stylesheets/material/element/_dropdown.scss +0 -132
  95. data/app/assets/stylesheets/material/element/_form-adv-checkbox.scss +0 -109
  96. data/app/assets/stylesheets/material/element/_form-adv-switch.scss +0 -102
  97. data/app/assets/stylesheets/material/element/_label.scss +0 -22
  98. data/app/assets/stylesheets/material/element/_sortable.scss +0 -8
  99. data/app/assets/stylesheets/material/element/_tab.scss +0 -107
  100. data/app/assets/stylesheets/material/element/_table.scss +0 -48
  101. data/app/assets/stylesheets/material/element/_tile.scss +0 -193
  102. data/app/assets/stylesheets/material/element/_toast.scss +0 -67
  103. data/app/assets/stylesheets/material/project.scss +0 -8
  104. data/app/assets/stylesheets/material/theme/_content.scss +0 -74
  105. data/app/assets/stylesheets/material/theme/_footer.scss +0 -17
  106. data/app/assets/stylesheets/material/theme/_header.scss +0 -128
@@ -1,10 +1,12 @@
1
- // modal iframe
2
- $(document).on('click', '.modal-close-iframe', function(e) {
3
- e.preventDefault();
1
+ // modale dialog vertical alignment
2
+ $(function () {
3
+ 'use strict';
4
4
 
5
- window.parent.closeModal(getTargetFromTrigger($(this)));
6
- });
5
+ $(document).on('hidden.bs.modal', '.modal-va-middle', function () {
6
+ $(this).removeClass('modal-va-middle-show');
7
+ });
7
8
 
8
- window.closeModal = function(iframe) {
9
- $(iframe).modal('hide');
10
- };
9
+ $(document).on('show.bs.modal', '.modal-va-middle', function () {
10
+ $(this).addClass('modal-va-middle-show');
11
+ });
12
+ });
@@ -0,0 +1,116 @@
1
+ // snackbar
2
+ (function ($) {
3
+ 'use strict';
4
+
5
+ var Snackbar = function (options) {
6
+ this.options = options;
7
+ this.$element = $('<div class="snackbar-inner">' + this.options.content + '</div>');
8
+ };
9
+
10
+ Snackbar.DEFAULTS = {
11
+ alive: 6000,
12
+ content: '&nbsp;',
13
+ hide: function () {},
14
+ show: function () {}
15
+ };
16
+
17
+ Snackbar.prototype.fbtn = function (margin) {
18
+ if ($(window).width() < 768 && $('.fbtn-container').length) {
19
+ var str = 'translateY(-' + margin + 'px)';
20
+ $('.fbtn-container').css({
21
+ '-webkit-transform': str,
22
+ 'transform': str
23
+ });
24
+ };
25
+ };
26
+
27
+ Snackbar.prototype.hide = function () {
28
+ var that = this;
29
+
30
+ this.$element.removeClass('in');
31
+
32
+ clearTimeout(this.$element.data('timer'));
33
+
34
+ if ($.support.transition) {
35
+ this.$element.one('bsTransitionEnd', function () {
36
+ that.options.hide(that.options);
37
+ that.$element.remove();
38
+ });
39
+ } else {
40
+ that.options.hide(that.options);
41
+ that.$element.remove();
42
+ }
43
+
44
+ this.fbtn('0');
45
+ };
46
+
47
+ Snackbar.prototype.show = function () {
48
+ var that = this;
49
+
50
+ if (!$('.snackbar').length) {
51
+ $(document.body).append('<div class="snackbar"></div>');
52
+ };
53
+
54
+ this.$element.appendTo('.snackbar').show().addClass(function () {
55
+ that.$element.on('click', '[data-dismiss="snackbar"]', function () {
56
+ that.hide();
57
+ });
58
+
59
+ that.$element.data('timer', setTimeout(function () {
60
+ that.hide();
61
+ }, that.options.alive));
62
+
63
+ that.$element.on('mouseenter', function () {
64
+ clearTimeout(that.$element.data('timer'));
65
+ }).on('mouseleave', function () {
66
+ that.$element.data('timer', setTimeout(function () {
67
+ that.hide();
68
+ }, that.options.alive));
69
+ });
70
+
71
+ that.options.show(that.options);
72
+
73
+ return 'in';
74
+ });
75
+
76
+ this.fbtn(this.$element.outerHeight());
77
+ };
78
+
79
+ function Plugin (option) {
80
+ return this.each(function () {
81
+ var $this = $(document.body);
82
+ var data = $this.data('bs.snackbar');
83
+ var options = $.extend({}, Snackbar.DEFAULTS, option);
84
+
85
+ if (!data) {
86
+ $this.data('bs.snackbar', (data = new Snackbar(options)));
87
+ data.show();
88
+ } else if ($('.snackbar-inner').length && !$('.snackbar-inner.old').length) {
89
+ $('.snackbar-inner.in').addClass('old')
90
+ data.hide();
91
+ if ($.support.transition) {
92
+ $(document).one('bsTransitionEnd', '.snackbar-inner.old', function () {
93
+ $this.data('bs.snackbar', (data = new Snackbar(options)));
94
+ data.show();
95
+ });
96
+ } else {
97
+ $this.data('bs.snackbar', (data = new Snackbar(options)));
98
+ data.show();
99
+ };
100
+ } else if (!$('.snackbar-inner').length) {
101
+ $this.data('bs.snackbar', (data = new Snackbar(options)));
102
+ data.show();
103
+ };
104
+ });
105
+ };
106
+
107
+ var old = $.fn.snackbar;
108
+
109
+ $.fn.snackbar = Plugin;
110
+ $.fn.snackbar.Constructor = Snackbar;
111
+
112
+ $.fn.snackbar.noConflict = function () {
113
+ $.fn.snackbar = old;
114
+ return this;
115
+ };
116
+ }(jQuery));
@@ -1,31 +1,51 @@
1
1
  // tab switch
2
- tabSwitch = function(newTab, oldTab) {
3
- var $nav = newTab.closest('.tab-nav'),
4
- $navIndicator = $('.tab-nav-indicator', $nav),
5
- navOffset = $nav.offset().left,
6
- navWidth = $nav.width(),
7
- newTabOffset = newTab.offset().left,
8
- newTabWidth = newTab.outerWidth();
9
-
10
- if (oldTab != null && oldTab.offset().left > newTabOffset) {
11
- $navIndicator.addClass('reverse');
12
- setTimeout(function() {
13
- $navIndicator.removeClass('reverse');
14
- }, 450);
15
- };
16
-
17
- $navIndicator.css({
18
- left: (newTabOffset - navOffset),
19
- right: navOffset + navWidth - newTabOffset - newTabWidth
2
+ (function ($) {
3
+ 'use strict';
4
+
5
+ $.fn.tabSwitch = function (oldTab) {
6
+ var $this = $(this),
7
+ $thisNav = $this.closest('.tab-nav'),
8
+ $thisNavIndicator = $('.tab-nav-indicator', $thisNav),
9
+ thisLeft = $this.offset().left,
10
+ thisNavLeft = $thisNav.offset().left,
11
+ thisNavWidth = $thisNav.outerWidth();
12
+
13
+ if (oldTab !== undefined && oldTab[0] !== undefined) {
14
+ var oldTabLeft = oldTab.offset().left;
15
+
16
+ $thisNavIndicator.css({
17
+ left: (oldTabLeft - thisNavLeft),
18
+ right: (thisNavLeft + thisNavWidth - oldTabLeft - oldTab.outerWidth())
19
+ });
20
+
21
+ if (oldTab.offset().left > thisLeft) {
22
+ $thisNavIndicator.addClass('reverse');
23
+
24
+ $thisNavIndicator.one('webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend', function () {
25
+ $thisNavIndicator.removeClass('reverse');
26
+ });
27
+ };
28
+ };
29
+
30
+ $thisNavIndicator.addClass('animate').css({
31
+ left: (thisLeft - thisNavLeft),
32
+ right: (thisNavLeft + thisNavWidth - thisLeft - $this.outerWidth())
33
+ }).one('webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend', function () {
34
+ $thisNavIndicator.removeClass('animate');
35
+ });
36
+
37
+ return this;
38
+ }
39
+ })(jQuery);
40
+
41
+ $(function () {
42
+ 'use strict';
43
+
44
+ $('.tab-nav').each(function () {
45
+ $(this).append('<div class="tab-nav-indicator"></div>');
20
46
  });
21
- }
22
47
 
23
- $(document).on('show.bs.tab', '.tab-nav a[data-toggle="tab"]', function(e) {
24
- tabSwitch($(e.target), $(e.relatedTarget));
48
+ $(document).on('show.bs.tab', '.tab-nav a[data-toggle="tab"]', function (e) {
49
+ $(e.target).tabSwitch($(e.relatedTarget));
50
+ });
25
51
  });
26
-
27
- // tab switch indicator
28
- $('.tab-nav').each(function() {
29
- $(this).append('<div class="tab-nav-indicator"></div>');
30
- tabSwitch($('.nav > li.active', $(this)), null);
31
- });
@@ -1,86 +1,181 @@
1
1
  // tile
2
- $(document).on('click', function(e) {
3
- var $target = $(e.target);
2
+ (function ($) {
3
+ 'use strict';
4
4
 
5
- if ($target.is('[data-toggle="tile"], [data-toggle="tile"] *') && !$target.is('[data-ignore="tile"], [data-ignore="tile"] *')) {
6
- var $trigger = $target.closest('[data-toggle="tile"]');
7
- if ($trigger.attr('data-parent') != null) {
8
- $($trigger.attr('data-parent')).find('.tile-active-show').collapse('hide');
5
+ var Tile = function (element, options) {
6
+ this.options = $.extend({}, Tile.DEFAULTS, options);
7
+ this.transitioning = null;
8
+ this.$element = $(element);
9
+
10
+ if (this.options.parent) {
11
+ this.$parent = this.getParent();
12
+ };
13
+
14
+ if (this.options.toggle) {
15
+ this.toggle();
9
16
  };
10
- $(getTargetFromTrigger($trigger)).collapse('toggle');
11
- } else if ($target.is('[data-dismiss="tile"]')) {
12
- $target.closest('.tile-collapse').find('.tile-active-show').collapse('hide');
13
- } else if (!$target.is('.tile-collapse, .tile-collapse *')) {
14
- tReset();
15
17
  };
16
- });
17
18
 
18
- tReset = function () {
19
- $('.tile-collapse.active').each(function(index) {
20
- var $collapse = $('.tile-active-show', $(this));
21
- if (!$collapse.hasClass('tile-active-show-still')) {
22
- $collapse.collapse('hide');
19
+ if (!$.fn.collapse) {
20
+ throw new Error('Menu requires Bootstrap collapse.js');
21
+ };
22
+
23
+ Tile.DEFAULTS = {
24
+ keyboard: true,
25
+ toggle: true
26
+ };
27
+ Tile.TRANSITION_DURATION = 150;
28
+
29
+ Tile.prototype = $.extend({}, $.fn.collapse.Constructor.prototype);
30
+
31
+ Tile.prototype.escape = function () {
32
+ if (this.$element.hasClass('in') && this.options.keyboard) {
33
+ $(document).on('keydown.dismiss.bs.tile', $.proxy(function (e) {
34
+ e.which == 27 && this.hide();
35
+ }, this));
36
+ } else if (!this.$element.hasClass('in')) {
37
+ this.$element.off('keydown.dismiss.bs.tile');
23
38
  };
24
- });
25
- }
26
-
27
- // tile hide
28
- $(document).on('hide.bs.collapse', '.tile-active-show', function() {
29
- $(this).closest('.tile-collapse').css({
30
- '-webkit-transition-delay': '',
31
- 'transition-delay': ''
32
- }).removeClass('active');
33
- });
34
-
35
- // tile show
36
- $(document).on('show.bs.collapse', '.tile-active-show', function() {
37
- $(this).closest('.tile-collapse').css({
38
- '-webkit-transition-delay': '',
39
- 'transition-delay': ''
40
- }).addClass('active');
41
- });
42
-
43
- // tile wrap animation
44
- $('.tile-wrap-animation').each(function(index) {
45
- var tileAnimationDelay = 0,
46
- tileAnimationTransform = 100;
47
-
48
- $('> .tile', $(this)).each(function(index) {
49
- $(this).css({
50
- '-webkit-transform': 'translate(0, ' + tileAnimationTransform + '%)',
51
- '-ms-transform': 'translate(0, ' + tileAnimationTransform + '%)',
52
- 'transform': 'translate(0, ' + tileAnimationTransform + '%)',
53
- '-webkit-transition-delay': tileAnimationDelay + 's',
54
- 'transition-delay': tileAnimationDelay + 's'
55
- });
56
-
57
- tileAnimationDelay = tileAnimationDelay + 0.1;
58
- tileAnimationTransform = tileAnimationTransform + 10;
59
- });
60
- });
39
+ };
61
40
 
62
- $(window).on('DOMContentLoaded scroll', function() {
63
- tileInView();
64
- });
41
+ Tile.prototype.hide = function () {
42
+ if (this.transitioning || !this.$element.hasClass('in')) {
43
+ return;
44
+ };
65
45
 
66
- tileInView = function () {
67
- $('.tile-wrap-animation:not(.isinview)').each(function() {
68
- var $this = $(this);
69
- if (tileInViewCheck($this) && (!$this.hasClass('avoid-fout') || ($this.hasClass('avoid-fout') && $this.hasClass('avoid-fout-done'))) && (!$this.hasClass('el-loading') || ($this.hasClass('el-loading') && $this.hasClass('el-loading-done'))) && !$this.parents('.avoid-fout:not(.avoid-fout-done)').length && !$this.parents('.el-loading:not(.el-loading-done)').length) {
70
- $this.addClass('isinview');
46
+ var startEvent = $.Event('hide.bs.tile');
47
+
48
+ this.$element.trigger(startEvent);
49
+
50
+ if (startEvent.isDefaultPrevented()) {
51
+ return;
71
52
  };
72
- });
73
- }
74
53
 
75
- tileInViewCheck = function (tile) {
76
- tile = tile[0];
54
+ var dimension = this.dimension();
55
+
56
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight;
77
57
 
78
- var rect = tile.getBoundingClientRect();
58
+ this.$element.addClass('collapsing').removeClass('collapse in');
79
59
 
80
- return (
81
- rect.top <= window.innerHeight &&
82
- rect.right >= 0 &&
83
- rect.bottom >= 0 &&
84
- rect.left <= window.innerWidth
85
- );
86
- }
60
+ this.$element.closest('.tile-collapse').removeClass('active');
61
+
62
+ this.transitioning = 1
63
+
64
+ var complete = function () {
65
+ this.transitioning = 0;
66
+ this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.tile');
67
+ this.escape();
68
+ };
69
+
70
+ if (!$.support.transition) {
71
+ return complete.call(this);
72
+ };
73
+
74
+ this.$element[dimension](0).one('bsTransitionEnd', $.proxy(complete, this)).emulateTransitionEnd(Tile.TRANSITION_DURATION);
75
+ };
76
+
77
+ Tile.prototype.show = function () {
78
+ if (this.transitioning || this.$element.hasClass('in')) {
79
+ return;
80
+ };
81
+
82
+ var actives = this.$parent && this.$parent.find('.tile-collapse').children('.in, .collapsing');
83
+ var activesData;
84
+
85
+ if (actives && actives.length) {
86
+ activesData = actives.data('bs.tile');
87
+ if (activesData && activesData.transitioning) {
88
+ return;
89
+ };
90
+ };
91
+
92
+ var startEvent = $.Event('show.bs.tile');
93
+
94
+ this.$element.trigger(startEvent);
95
+
96
+ if (startEvent.isDefaultPrevented()) {
97
+ return;
98
+ };
99
+
100
+ if (actives && actives.length) {
101
+ Plugin.call(actives, 'hide');
102
+ activesData || actives.data('bs.tile', null);
103
+ };
104
+
105
+ var dimension = this.dimension();
106
+
107
+ this.$element.removeClass('collapse').addClass('collapsing')[dimension](0);
108
+
109
+ this.$element.closest('.tile-collapse').addClass('active');
110
+
111
+ this.transitioning = 1;
112
+
113
+ var complete = function () {
114
+ this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('');
115
+ this.transitioning = 0;
116
+ this.$element.trigger('shown.bs.tile');
117
+ this.escape();
118
+ };
119
+
120
+ if (!$.support.transition) {
121
+ return complete.call(this);
122
+ };
123
+
124
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'));
125
+
126
+ this.$element.one('bsTransitionEnd', $.proxy(complete, this)).emulateTransitionEnd(Tile.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]);
127
+ };
128
+
129
+ function getTargetFromTrigger($trigger) {
130
+ var href;
131
+ var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '');
132
+
133
+ return $(target);
134
+ };
135
+
136
+ function Plugin(option) {
137
+ return this.each(function () {
138
+ var $this = $(this);
139
+ var data = $this.data('bs.tile');
140
+ var options = $.extend({}, Tile.DEFAULTS, $this.data(), typeof option == 'object' && option);
141
+
142
+ if (!data && options.toggle && /show|hide/.test(option)) {
143
+ options.toggle = false;
144
+ };
145
+
146
+ if (!data) {
147
+ $this.data('bs.tile', (data = new Tile(this, options)));
148
+ };
149
+
150
+ if (typeof option == 'string') {
151
+ data[option]();
152
+ };
153
+ })
154
+ };
155
+
156
+ var old = $.fn.tile;
157
+
158
+ $.fn.tile = Plugin;
159
+ $.fn.tile.Constructor = Tile;
160
+
161
+ $.fn.tile.noConflict = function () {
162
+ $.fn.tile = old;
163
+ return this;
164
+ };
165
+
166
+ $(document).on('click.bs.tile.data-api', '[data-toggle="tile"]', function (e) {
167
+ var $this = $(this);
168
+
169
+ if (!$(e.target).is('[data-ignore="tile"], [data-ignore="tile"] *')) {
170
+ if (!$this.attr('data-target')) {
171
+ e.preventDefault();
172
+ };
173
+
174
+ var $target = getTargetFromTrigger($this);
175
+ var data = $target.data('bs.tile');
176
+ var option = data ? 'toggle' : $this.data();
177
+
178
+ Plugin.call($target, option);
179
+ };
180
+ });
181
+ }(jQuery));