materialize-sass 0.97.8 → 1.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitattributes +1 -0
- data/.gitignore +1 -0
- data/README.md +34 -32
- data/Rakefile +38 -21
- data/assets/javascripts/materialize/anime.min.js +417 -0
- data/assets/javascripts/materialize/autocomplete.js +504 -0
- data/assets/javascripts/materialize/buttons.js +409 -0
- data/assets/javascripts/materialize/cards.js +34 -0
- data/assets/javascripts/materialize/carousel.js +797 -0
- data/assets/javascripts/materialize/cash.js +990 -0
- data/assets/javascripts/materialize/characterCounter.js +180 -0
- data/assets/javascripts/materialize/chips.js +564 -0
- data/assets/javascripts/materialize/collapsible.js +337 -0
- data/assets/javascripts/materialize/component.js +57 -0
- data/assets/javascripts/materialize/datepicker.js +935 -0
- data/assets/javascripts/materialize/dropdown.js +659 -0
- data/assets/javascripts/materialize/extras/nouislider.js +2147 -0
- data/assets/javascripts/materialize/extras/nouislider.min.js +1 -0
- data/assets/javascripts/materialize/forms.js +244 -0
- data/assets/javascripts/materialize/global.js +408 -0
- data/assets/javascripts/materialize/materialbox.js +513 -0
- data/assets/javascripts/materialize/modal.js +449 -0
- data/assets/javascripts/materialize/parallax.js +173 -0
- data/assets/javascripts/materialize/pushpin.js +179 -0
- data/assets/javascripts/materialize/range.js +310 -0
- data/assets/javascripts/materialize/scrollspy.js +328 -0
- data/assets/javascripts/materialize/select.js +497 -0
- data/assets/javascripts/materialize/sidenav.js +655 -0
- data/assets/javascripts/materialize/slider.js +424 -0
- data/assets/javascripts/materialize/tabs.js +476 -0
- data/assets/javascripts/materialize/tapTarget.js +364 -0
- data/assets/javascripts/materialize/timepicker.js +647 -0
- data/assets/javascripts/materialize/toasts.js +355 -0
- data/assets/javascripts/materialize/tooltip.js +351 -0
- data/{app/assets → assets}/javascripts/materialize/waves.js +42 -47
- data/{app/assets → assets}/javascripts/materialize-sprockets.js +12 -13
- data/assets/javascripts/materialize.js +12374 -0
- data/assets/stylesheets/materialize/components/_badges.scss +55 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_buttons.scss +99 -58
- data/{app/assets → assets}/stylesheets/materialize/components/_cards.scss +14 -6
- data/{app/assets → assets}/stylesheets/materialize/components/_carousel.scss +12 -7
- data/{app/assets → assets}/stylesheets/materialize/components/_chips.scss +13 -6
- data/{app/assets → assets}/stylesheets/materialize/components/_collapsible.scss +16 -15
- data/assets/stylesheets/materialize/components/_color-classes.scss +32 -0
- data/{app/assets/stylesheets/materialize/components/_color.scss → assets/stylesheets/materialize/components/_color-variables.scss} +2 -44
- data/assets/stylesheets/materialize/components/_datepicker.scss +191 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_dropdown.scss +35 -15
- data/{app/assets → assets}/stylesheets/materialize/components/_global.scss +96 -125
- data/{app/assets → assets}/stylesheets/materialize/components/_grid.scss +45 -36
- data/{app/assets → assets}/stylesheets/materialize/components/_icons-material-design.scss +0 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_materialbox.scss +13 -12
- data/{app/assets → assets}/stylesheets/materialize/components/_modal.scss +7 -3
- data/{app/assets → assets}/stylesheets/materialize/components/_navbar.scss +29 -11
- data/assets/stylesheets/materialize/components/_normalize.scss +447 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_preloader.scss +2 -2
- data/assets/stylesheets/materialize/components/_pulse.scss +34 -0
- data/{app/assets/stylesheets/materialize/components/_sideNav.scss → assets/stylesheets/materialize/components/_sidenav.scss} +47 -47
- data/{app/assets → assets}/stylesheets/materialize/components/_slider.scss +0 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_table_of_contents.scss +5 -5
- data/{app/assets → assets}/stylesheets/materialize/components/_tabs.scss +10 -10
- data/assets/stylesheets/materialize/components/_tapTarget.scss +103 -0
- data/assets/stylesheets/materialize/components/_timepicker.scss +183 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_toast.scss +7 -14
- data/{app/assets → assets}/stylesheets/materialize/components/_tooltip.scss +3 -3
- data/assets/stylesheets/materialize/components/_transitions.scss +13 -0
- data/{app/assets → assets}/stylesheets/materialize/components/_typography.scss +8 -9
- data/{app/assets → assets}/stylesheets/materialize/components/_variables.scss +65 -29
- data/assets/stylesheets/materialize/components/_waves.scss +114 -0
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_checkboxes.scss +26 -46
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_file-input.scss +6 -0
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_forms.scss +0 -0
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_input-fields.scss +131 -63
- data/assets/stylesheets/materialize/components/forms/_radio-buttons.scss +115 -0
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_range.scss +35 -33
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_select.scss +88 -19
- data/{app/assets → assets}/stylesheets/materialize/components/forms/_switches.scss +32 -21
- data/assets/stylesheets/materialize/extras/nouislider.css +406 -0
- data/{app/assets → assets}/stylesheets/materialize.scss +10 -9
- data/lib/materialize-sass/engine.rb +9 -7
- data/lib/materialize-sass/helpers.rb +38 -0
- data/lib/materialize-sass/version.rb +1 -1
- data/lib/materialize-sass.rb +13 -28
- data/materialize-sass.gemspec +5 -5
- metadata +97 -119
- data/app/assets/fonts/roboto/Roboto-Bold.eot +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.eot +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.eot +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.eot +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.eot +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
- data/app/assets/javascripts/materialize/animation.js +0 -9
- data/app/assets/javascripts/materialize/buttons.js +0 -267
- data/app/assets/javascripts/materialize/cards.js +0 -26
- data/app/assets/javascripts/materialize/carousel.js +0 -454
- data/app/assets/javascripts/materialize/character_counter.js +0 -72
- data/app/assets/javascripts/materialize/chips.js +0 -289
- data/app/assets/javascripts/materialize/collapsible.js +0 -160
- data/app/assets/javascripts/materialize/date_picker/picker.date.js +0 -1430
- data/app/assets/javascripts/materialize/date_picker/picker.js +0 -1123
- data/app/assets/javascripts/materialize/dropdown.js +0 -265
- data/app/assets/javascripts/materialize/extras/nouislider.js +0 -1666
- data/app/assets/javascripts/materialize/extras/nouislider.min.js +0 -1
- data/app/assets/javascripts/materialize/forms.js +0 -682
- data/app/assets/javascripts/materialize/global.js +0 -98
- data/app/assets/javascripts/materialize/hammer.min.js +0 -1
- data/app/assets/javascripts/materialize/init.js +0 -174
- data/app/assets/javascripts/materialize/initial.js +0 -11
- data/app/assets/javascripts/materialize/jquery.easing.1.3.js +0 -205
- data/app/assets/javascripts/materialize/jquery.hammer.js +0 -33
- data/app/assets/javascripts/materialize/jquery.timeago.min.js +0 -1
- data/app/assets/javascripts/materialize/materialbox.js +0 -269
- data/app/assets/javascripts/materialize/modal.js +0 -184
- data/app/assets/javascripts/materialize/parallax.js +0 -58
- data/app/assets/javascripts/materialize/prism.js +0 -8
- data/app/assets/javascripts/materialize/pushpin.js +0 -71
- data/app/assets/javascripts/materialize/scrollFire.js +0 -48
- data/app/assets/javascripts/materialize/scrollspy.js +0 -284
- data/app/assets/javascripts/materialize/sideNav.js +0 -370
- data/app/assets/javascripts/materialize/slider.js +0 -321
- data/app/assets/javascripts/materialize/tabs.js +0 -164
- data/app/assets/javascripts/materialize/toasts.js +0 -137
- data/app/assets/javascripts/materialize/tooltip.js +0 -236
- data/app/assets/javascripts/materialize/transitions.js +0 -169
- data/app/assets/javascripts/materialize/velocity.min.js +0 -5
- data/app/assets/javascripts/materialize.js +0 -5
- data/app/assets/stylesheets/materialize/components/_mixins.scss +0 -5
- data/app/assets/stylesheets/materialize/components/_normalize.scss +0 -424
- data/app/assets/stylesheets/materialize/components/_prefixer.scss +0 -384
- data/app/assets/stylesheets/materialize/components/_roboto.scss +0 -49
- data/app/assets/stylesheets/materialize/components/_waves.scss +0 -177
- data/app/assets/stylesheets/materialize/components/date_picker/_default.date.scss +0 -435
- data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +0 -201
- data/app/assets/stylesheets/materialize/components/date_picker/_default.time.scss +0 -125
- data/app/assets/stylesheets/materialize/components/forms/_radio-buttons.scss +0 -117
- data/app/assets/stylesheets/materialize/extras/nouislider.css +0 -259
@@ -0,0 +1,409 @@
|
|
1
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
2
|
+
|
3
|
+
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
|
4
|
+
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6
|
+
|
7
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
8
|
+
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
10
|
+
|
11
|
+
(function ($, anim) {
|
12
|
+
'use strict';
|
13
|
+
|
14
|
+
var _defaults = {
|
15
|
+
direction: 'top',
|
16
|
+
hoverEnabled: true,
|
17
|
+
toolbarEnabled: false
|
18
|
+
};
|
19
|
+
|
20
|
+
$.fn.reverse = [].reverse;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* @class
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
|
27
|
+
var FloatingActionButton = function (_Component) {
|
28
|
+
_inherits(FloatingActionButton, _Component);
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Construct FloatingActionButton instance
|
32
|
+
* @constructor
|
33
|
+
* @param {Element} el
|
34
|
+
* @param {Object} options
|
35
|
+
*/
|
36
|
+
function FloatingActionButton(el, options) {
|
37
|
+
_classCallCheck(this, FloatingActionButton);
|
38
|
+
|
39
|
+
var _this = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options));
|
40
|
+
|
41
|
+
_this.el.M_FloatingActionButton = _this;
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Options for the fab
|
45
|
+
* @member FloatingActionButton#options
|
46
|
+
* @prop {Boolean} [direction] - Direction fab menu opens
|
47
|
+
* @prop {Boolean} [hoverEnabled=true] - Enable hover vs click
|
48
|
+
* @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition
|
49
|
+
*/
|
50
|
+
_this.options = $.extend({}, FloatingActionButton.defaults, options);
|
51
|
+
|
52
|
+
_this.isOpen = false;
|
53
|
+
_this.$anchor = _this.$el.children('a').first();
|
54
|
+
_this.$menu = _this.$el.children('ul').first();
|
55
|
+
_this.$floatingBtns = _this.$el.find('ul .btn-floating');
|
56
|
+
_this.$floatingBtnsReverse = _this.$el.find('ul .btn-floating').reverse();
|
57
|
+
_this.offsetY = 0;
|
58
|
+
_this.offsetX = 0;
|
59
|
+
|
60
|
+
_this.$el.addClass('direction-' + _this.options.direction);
|
61
|
+
if (_this.options.direction === 'top') {
|
62
|
+
_this.offsetY = 40;
|
63
|
+
} else if (_this.options.direction === 'right') {
|
64
|
+
_this.offsetX = -40;
|
65
|
+
} else if (_this.options.direction === 'bottom') {
|
66
|
+
_this.offsetY = -40;
|
67
|
+
} else {
|
68
|
+
_this.offsetX = 40;
|
69
|
+
}
|
70
|
+
_this._setupEventHandlers();
|
71
|
+
return _this;
|
72
|
+
}
|
73
|
+
|
74
|
+
_createClass(FloatingActionButton, [{
|
75
|
+
key: 'destroy',
|
76
|
+
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Teardown component
|
80
|
+
*/
|
81
|
+
value: function destroy() {
|
82
|
+
this._removeEventHandlers();
|
83
|
+
this.el.M_FloatingActionButton = undefined;
|
84
|
+
}
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Setup Event Handlers
|
88
|
+
*/
|
89
|
+
|
90
|
+
}, {
|
91
|
+
key: '_setupEventHandlers',
|
92
|
+
value: function _setupEventHandlers() {
|
93
|
+
this._handleFABClickBound = this._handleFABClick.bind(this);
|
94
|
+
this._handleOpenBound = this.open.bind(this);
|
95
|
+
this._handleCloseBound = this.close.bind(this);
|
96
|
+
|
97
|
+
if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
|
98
|
+
this.el.addEventListener('mouseenter', this._handleOpenBound);
|
99
|
+
this.el.addEventListener('mouseleave', this._handleCloseBound);
|
100
|
+
} else {
|
101
|
+
this.el.addEventListener('click', this._handleFABClickBound);
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Remove Event Handlers
|
107
|
+
*/
|
108
|
+
|
109
|
+
}, {
|
110
|
+
key: '_removeEventHandlers',
|
111
|
+
value: function _removeEventHandlers() {
|
112
|
+
if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
|
113
|
+
this.el.removeEventListener('mouseenter', this._handleOpenBound);
|
114
|
+
this.el.removeEventListener('mouseleave', this._handleCloseBound);
|
115
|
+
} else {
|
116
|
+
this.el.removeEventListener('click', this._handleFABClickBound);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Handle FAB Click
|
122
|
+
*/
|
123
|
+
|
124
|
+
}, {
|
125
|
+
key: '_handleFABClick',
|
126
|
+
value: function _handleFABClick() {
|
127
|
+
if (this.isOpen) {
|
128
|
+
this.close();
|
129
|
+
} else {
|
130
|
+
this.open();
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Handle Document Click
|
136
|
+
* @param {Event} e
|
137
|
+
*/
|
138
|
+
|
139
|
+
}, {
|
140
|
+
key: '_handleDocumentClick',
|
141
|
+
value: function _handleDocumentClick(e) {
|
142
|
+
if (!$(e.target).closest(this.$menu).length) {
|
143
|
+
this.close();
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Open FAB
|
149
|
+
*/
|
150
|
+
|
151
|
+
}, {
|
152
|
+
key: 'open',
|
153
|
+
value: function open() {
|
154
|
+
if (this.isOpen) {
|
155
|
+
return;
|
156
|
+
}
|
157
|
+
|
158
|
+
if (this.options.toolbarEnabled) {
|
159
|
+
this._animateInToolbar();
|
160
|
+
} else {
|
161
|
+
this._animateInFAB();
|
162
|
+
}
|
163
|
+
this.isOpen = true;
|
164
|
+
}
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Close FAB
|
168
|
+
*/
|
169
|
+
|
170
|
+
}, {
|
171
|
+
key: 'close',
|
172
|
+
value: function close() {
|
173
|
+
if (!this.isOpen) {
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
|
177
|
+
if (this.options.toolbarEnabled) {
|
178
|
+
window.removeEventListener('scroll', this._handleCloseBound, true);
|
179
|
+
document.body.removeEventListener('click', this._handleDocumentClickBound, true);
|
180
|
+
this._animateOutToolbar();
|
181
|
+
} else {
|
182
|
+
this._animateOutFAB();
|
183
|
+
}
|
184
|
+
this.isOpen = false;
|
185
|
+
}
|
186
|
+
|
187
|
+
/**
|
188
|
+
* Classic FAB Menu open
|
189
|
+
*/
|
190
|
+
|
191
|
+
}, {
|
192
|
+
key: '_animateInFAB',
|
193
|
+
value: function _animateInFAB() {
|
194
|
+
var _this2 = this;
|
195
|
+
|
196
|
+
this.$el.addClass('active');
|
197
|
+
|
198
|
+
var time = 0;
|
199
|
+
this.$floatingBtnsReverse.each(function (el) {
|
200
|
+
anim({
|
201
|
+
targets: el,
|
202
|
+
opacity: 1,
|
203
|
+
scale: [0.4, 1],
|
204
|
+
translateY: [_this2.offsetY, 0],
|
205
|
+
translateX: [_this2.offsetX, 0],
|
206
|
+
duration: 275,
|
207
|
+
delay: time,
|
208
|
+
easing: 'easeInOutQuad'
|
209
|
+
});
|
210
|
+
time += 40;
|
211
|
+
});
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Classic FAB Menu close
|
216
|
+
*/
|
217
|
+
|
218
|
+
}, {
|
219
|
+
key: '_animateOutFAB',
|
220
|
+
value: function _animateOutFAB() {
|
221
|
+
var _this3 = this;
|
222
|
+
|
223
|
+
this.$floatingBtnsReverse.each(function (el) {
|
224
|
+
anim.remove(el);
|
225
|
+
anim({
|
226
|
+
targets: el,
|
227
|
+
opacity: 0,
|
228
|
+
scale: 0.4,
|
229
|
+
translateY: _this3.offsetY,
|
230
|
+
translateX: _this3.offsetX,
|
231
|
+
duration: 175,
|
232
|
+
easing: 'easeOutQuad',
|
233
|
+
complete: function () {
|
234
|
+
_this3.$el.removeClass('active');
|
235
|
+
}
|
236
|
+
});
|
237
|
+
});
|
238
|
+
}
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Toolbar transition Menu open
|
242
|
+
*/
|
243
|
+
|
244
|
+
}, {
|
245
|
+
key: '_animateInToolbar',
|
246
|
+
value: function _animateInToolbar() {
|
247
|
+
var _this4 = this;
|
248
|
+
|
249
|
+
var scaleFactor = void 0;
|
250
|
+
var windowWidth = window.innerWidth;
|
251
|
+
var windowHeight = window.innerHeight;
|
252
|
+
var btnRect = this.el.getBoundingClientRect();
|
253
|
+
var backdrop = $('<div class="fab-backdrop"></div>');
|
254
|
+
var fabColor = this.$anchor.css('background-color');
|
255
|
+
this.$anchor.append(backdrop);
|
256
|
+
|
257
|
+
this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2;
|
258
|
+
this.offsetY = windowHeight - btnRect.bottom;
|
259
|
+
scaleFactor = windowWidth / backdrop[0].clientWidth;
|
260
|
+
this.btnBottom = btnRect.bottom;
|
261
|
+
this.btnLeft = btnRect.left;
|
262
|
+
this.btnWidth = btnRect.width;
|
263
|
+
|
264
|
+
// Set initial state
|
265
|
+
this.$el.addClass('active');
|
266
|
+
this.$el.css({
|
267
|
+
'text-align': 'center',
|
268
|
+
width: '100%',
|
269
|
+
bottom: 0,
|
270
|
+
left: 0,
|
271
|
+
transform: 'translateX(' + this.offsetX + 'px)',
|
272
|
+
transition: 'none'
|
273
|
+
});
|
274
|
+
this.$anchor.css({
|
275
|
+
transform: 'translateY(' + -this.offsetY + 'px)',
|
276
|
+
transition: 'none'
|
277
|
+
});
|
278
|
+
backdrop.css({
|
279
|
+
'background-color': fabColor
|
280
|
+
});
|
281
|
+
|
282
|
+
setTimeout(function () {
|
283
|
+
_this4.$el.css({
|
284
|
+
transform: '',
|
285
|
+
transition: 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'
|
286
|
+
});
|
287
|
+
_this4.$anchor.css({
|
288
|
+
overflow: 'visible',
|
289
|
+
transform: '',
|
290
|
+
transition: 'transform .2s'
|
291
|
+
});
|
292
|
+
|
293
|
+
setTimeout(function () {
|
294
|
+
_this4.$el.css({
|
295
|
+
overflow: 'hidden',
|
296
|
+
'background-color': fabColor
|
297
|
+
});
|
298
|
+
backdrop.css({
|
299
|
+
transform: 'scale(' + scaleFactor + ')',
|
300
|
+
transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
|
301
|
+
});
|
302
|
+
_this4.$menu.children('li').children('a').css({
|
303
|
+
opacity: 1
|
304
|
+
});
|
305
|
+
|
306
|
+
// Scroll to close.
|
307
|
+
_this4._handleDocumentClickBound = _this4._handleDocumentClick.bind(_this4);
|
308
|
+
window.addEventListener('scroll', _this4._handleCloseBound, true);
|
309
|
+
document.body.addEventListener('click', _this4._handleDocumentClickBound, true);
|
310
|
+
}, 100);
|
311
|
+
}, 0);
|
312
|
+
}
|
313
|
+
|
314
|
+
/**
|
315
|
+
* Toolbar transition Menu close
|
316
|
+
*/
|
317
|
+
|
318
|
+
}, {
|
319
|
+
key: '_animateOutToolbar',
|
320
|
+
value: function _animateOutToolbar() {
|
321
|
+
var _this5 = this;
|
322
|
+
|
323
|
+
var windowWidth = window.innerWidth;
|
324
|
+
var windowHeight = window.innerHeight;
|
325
|
+
var backdrop = this.$el.find('.fab-backdrop');
|
326
|
+
var fabColor = this.$anchor.css('background-color');
|
327
|
+
|
328
|
+
this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2;
|
329
|
+
this.offsetY = windowHeight - this.btnBottom;
|
330
|
+
|
331
|
+
// Hide backdrop
|
332
|
+
this.$el.removeClass('active');
|
333
|
+
this.$el.css({
|
334
|
+
'background-color': 'transparent',
|
335
|
+
transition: 'none'
|
336
|
+
});
|
337
|
+
this.$anchor.css({
|
338
|
+
transition: 'none'
|
339
|
+
});
|
340
|
+
backdrop.css({
|
341
|
+
transform: 'scale(0)',
|
342
|
+
'background-color': fabColor
|
343
|
+
});
|
344
|
+
this.$menu.children('li').children('a').css({
|
345
|
+
opacity: ''
|
346
|
+
});
|
347
|
+
|
348
|
+
setTimeout(function () {
|
349
|
+
backdrop.remove();
|
350
|
+
|
351
|
+
// Set initial state.
|
352
|
+
_this5.$el.css({
|
353
|
+
'text-align': '',
|
354
|
+
width: '',
|
355
|
+
bottom: '',
|
356
|
+
left: '',
|
357
|
+
overflow: '',
|
358
|
+
'background-color': '',
|
359
|
+
transform: 'translate3d(' + -_this5.offsetX + 'px,0,0)'
|
360
|
+
});
|
361
|
+
_this5.$anchor.css({
|
362
|
+
overflow: '',
|
363
|
+
transform: 'translate3d(0,' + _this5.offsetY + 'px,0)'
|
364
|
+
});
|
365
|
+
|
366
|
+
setTimeout(function () {
|
367
|
+
_this5.$el.css({
|
368
|
+
transform: 'translate3d(0,0,0)',
|
369
|
+
transition: 'transform .2s'
|
370
|
+
});
|
371
|
+
_this5.$anchor.css({
|
372
|
+
transform: 'translate3d(0,0,0)',
|
373
|
+
transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
|
374
|
+
});
|
375
|
+
}, 20);
|
376
|
+
}, 200);
|
377
|
+
}
|
378
|
+
}], [{
|
379
|
+
key: 'init',
|
380
|
+
value: function init(els, options) {
|
381
|
+
return _get(FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton), 'init', this).call(this, this, els, options);
|
382
|
+
}
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Get Instance
|
386
|
+
*/
|
387
|
+
|
388
|
+
}, {
|
389
|
+
key: 'getInstance',
|
390
|
+
value: function getInstance(el) {
|
391
|
+
var domElem = !!el.jquery ? el[0] : el;
|
392
|
+
return domElem.M_FloatingActionButton;
|
393
|
+
}
|
394
|
+
}, {
|
395
|
+
key: 'defaults',
|
396
|
+
get: function () {
|
397
|
+
return _defaults;
|
398
|
+
}
|
399
|
+
}]);
|
400
|
+
|
401
|
+
return FloatingActionButton;
|
402
|
+
}(Component);
|
403
|
+
|
404
|
+
M.FloatingActionButton = FloatingActionButton;
|
405
|
+
|
406
|
+
if (M.jQueryLoaded) {
|
407
|
+
M.initializeJqueryWrapper(FloatingActionButton, 'floatingActionButton', 'M_FloatingActionButton');
|
408
|
+
}
|
409
|
+
})(cash, M.anime);
|
@@ -0,0 +1,34 @@
|
|
1
|
+
(function ($, anim) {
|
2
|
+
$(document).on('click', '.card', function (e) {
|
3
|
+
if ($(this).children('.card-reveal').length) {
|
4
|
+
var $card = $(e.target).closest('.card');
|
5
|
+
if ($card.data('initialOverflow') === undefined) {
|
6
|
+
$card.data('initialOverflow', $card.css('overflow') === undefined ? '' : $card.css('overflow'));
|
7
|
+
}
|
8
|
+
var $cardReveal = $(this).find('.card-reveal');
|
9
|
+
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
|
10
|
+
// Make Reveal animate down and display none
|
11
|
+
anim({
|
12
|
+
targets: $cardReveal[0],
|
13
|
+
translateY: 0,
|
14
|
+
duration: 225,
|
15
|
+
easing: 'easeInOutQuad',
|
16
|
+
complete: function (anim) {
|
17
|
+
var el = anim.animatables[0].target;
|
18
|
+
$(el).css({ display: 'none' });
|
19
|
+
$card.css('overflow', $card.data('initialOverflow'));
|
20
|
+
}
|
21
|
+
});
|
22
|
+
} else if ($(e.target).is($('.card .activator')) || $(e.target).is($('.card .activator i'))) {
|
23
|
+
$card.css('overflow', 'hidden');
|
24
|
+
$cardReveal.css({ display: 'block' });
|
25
|
+
anim({
|
26
|
+
targets: $cardReveal[0],
|
27
|
+
translateY: '-100%',
|
28
|
+
duration: 300,
|
29
|
+
easing: 'easeInOutQuad'
|
30
|
+
});
|
31
|
+
}
|
32
|
+
}
|
33
|
+
});
|
34
|
+
})(cash, M.anime);
|