sigbit_admin_rails 0.0.3 → 0.0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/javascripts/jquery.nestable.js +484 -0
- data/assets/javascripts/jquery.sortable.min.js +4 -0
- data/assets/javascripts/sigbit-admin.js +61 -0
- data/assets/stylesheets/components/_header-navbar.scss +62 -0
- data/assets/stylesheets/components/_sidebar.scss +162 -0
- data/assets/stylesheets/components/action-toolbar.scss +14 -0
- data/assets/stylesheets/components/btn-circle.scss +25 -0
- data/assets/stylesheets/components/card.scss +45 -0
- data/assets/stylesheets/components/file-input.scss +87 -0
- data/assets/stylesheets/components/nestable.scss +149 -0
- data/assets/stylesheets/components/page-header.scss +30 -0
- data/assets/stylesheets/components/small-action-btns.scss +41 -0
- data/assets/stylesheets/components/sortable.scss +47 -0
- data/assets/stylesheets/mixins/nestable.scss +11 -0
- data/assets/stylesheets/sigbit-admin.scss +15 -0
- data/assets/stylesheets/variables.scss +688 -0
- data/lib/sigbit_admin_rails/railtie.rb +1 -1
- data/lib/sigbit_admin_rails.rb +8 -1
- metadata +50 -8
- data/vendor/assets/javascripts/sigbit-admin.js +0 -15187
- data/vendor/assets/javascripts/sigbit-admin.min.js +0 -5
- data/vendor/assets/stylesheets/sigbit-admin.css +0 -5157
- data/vendor/assets/stylesheets/sigbit-admin.min.css +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9675ed0e51c8d1354dbe058973496b92c2850dc9
|
4
|
+
data.tar.gz: 6c3c31fc81960b815040374c0cef2197ee4c9027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b34efbe05abcfff6db455f5d8ac95fb022aba49416b438c48f6579110cb9283914ee0b953eb509899f527202937458e945bf27502282fb6b2f829c1bc8309c8
|
7
|
+
data.tar.gz: 5b45307444d9b503cea27be6c363c76421e08162acd122c65a3b29cb83d3b8487165d3768897f28791c805e8fb16416d683e7bc176df2591de5adaf8e9bbc2fd
|
@@ -0,0 +1,484 @@
|
|
1
|
+
/*!
|
2
|
+
* Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
|
3
|
+
* Dual-licensed under the BSD or MIT licenses
|
4
|
+
*/
|
5
|
+
;(function($, window, document, undefined)
|
6
|
+
{
|
7
|
+
var hasTouch = 'ontouchstart' in document;
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Detect CSS pointer-events property
|
11
|
+
* events are normally disabled on the dragging element to avoid conflicts
|
12
|
+
* https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
|
13
|
+
*/
|
14
|
+
var hasPointerEvents = (function()
|
15
|
+
{
|
16
|
+
var el = document.createElement('div'),
|
17
|
+
docEl = document.documentElement;
|
18
|
+
if (!('pointerEvents' in el.style)) {
|
19
|
+
return false;
|
20
|
+
}
|
21
|
+
el.style.pointerEvents = 'auto';
|
22
|
+
el.style.pointerEvents = 'x';
|
23
|
+
docEl.appendChild(el);
|
24
|
+
var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';
|
25
|
+
docEl.removeChild(el);
|
26
|
+
return !!supports;
|
27
|
+
})();
|
28
|
+
|
29
|
+
var defaults = {
|
30
|
+
listNodeName : 'ol',
|
31
|
+
itemNodeName : 'li',
|
32
|
+
rootClass : 'dd',
|
33
|
+
listClass : 'dd-list',
|
34
|
+
itemClass : 'dd-item',
|
35
|
+
dragClass : 'dd-dragel',
|
36
|
+
handleClass : 'dd-handle',
|
37
|
+
collapsedClass : 'dd-collapsed',
|
38
|
+
placeClass : 'dd-placeholder',
|
39
|
+
noDragClass : 'dd-nodrag',
|
40
|
+
emptyClass : 'dd-empty',
|
41
|
+
expandBtnHTML : '<button data-action="expand" type="button">Expand</button>',
|
42
|
+
collapseBtnHTML : '<button data-action="collapse" type="button">Collapse</button>',
|
43
|
+
group : 0,
|
44
|
+
maxDepth : 5,
|
45
|
+
threshold : 20
|
46
|
+
};
|
47
|
+
|
48
|
+
function Plugin(element, options)
|
49
|
+
{
|
50
|
+
this.w = $(document);
|
51
|
+
this.el = $(element);
|
52
|
+
this.options = $.extend({}, defaults, options);
|
53
|
+
this.init();
|
54
|
+
}
|
55
|
+
|
56
|
+
Plugin.prototype = {
|
57
|
+
|
58
|
+
init: function()
|
59
|
+
{
|
60
|
+
var list = this;
|
61
|
+
|
62
|
+
list.reset();
|
63
|
+
|
64
|
+
list.el.data('nestable-group', this.options.group);
|
65
|
+
|
66
|
+
list.placeEl = $('<div class="' + list.options.placeClass + '"/>');
|
67
|
+
|
68
|
+
$.each(this.el.find(list.options.itemNodeName), function(k, el) {
|
69
|
+
list.setParent($(el));
|
70
|
+
});
|
71
|
+
|
72
|
+
list.el.on('click', 'button', function(e) {
|
73
|
+
if (list.dragEl) {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
var target = $(e.currentTarget),
|
77
|
+
action = target.data('action'),
|
78
|
+
item = target.parent(list.options.itemNodeName);
|
79
|
+
if (action === 'collapse') {
|
80
|
+
list.collapseItem(item);
|
81
|
+
}
|
82
|
+
if (action === 'expand') {
|
83
|
+
list.expandItem(item);
|
84
|
+
}
|
85
|
+
});
|
86
|
+
|
87
|
+
var onStartEvent = function(e)
|
88
|
+
{
|
89
|
+
var handle = $(e.target);
|
90
|
+
if (!handle.hasClass(list.options.handleClass)) {
|
91
|
+
if (handle.closest('.' + list.options.noDragClass).length) {
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
handle = handle.closest('.' + list.options.handleClass);
|
95
|
+
}
|
96
|
+
|
97
|
+
if (!handle.length || list.dragEl) {
|
98
|
+
return;
|
99
|
+
}
|
100
|
+
|
101
|
+
list.isTouch = /^touch/.test(e.type);
|
102
|
+
if (list.isTouch && e.touches.length !== 1) {
|
103
|
+
return;
|
104
|
+
}
|
105
|
+
|
106
|
+
e.preventDefault();
|
107
|
+
list.dragStart(e.touches ? e.touches[0] : e);
|
108
|
+
};
|
109
|
+
|
110
|
+
var onMoveEvent = function(e)
|
111
|
+
{
|
112
|
+
if (list.dragEl) {
|
113
|
+
e.preventDefault();
|
114
|
+
list.dragMove(e.touches ? e.touches[0] : e);
|
115
|
+
}
|
116
|
+
};
|
117
|
+
|
118
|
+
var onEndEvent = function(e)
|
119
|
+
{
|
120
|
+
if (list.dragEl) {
|
121
|
+
e.preventDefault();
|
122
|
+
list.dragStop(e.touches ? e.touches[0] : e);
|
123
|
+
}
|
124
|
+
};
|
125
|
+
|
126
|
+
if (hasTouch) {
|
127
|
+
list.el[0].addEventListener('touchstart', onStartEvent, false);
|
128
|
+
window.addEventListener('touchmove', onMoveEvent, false);
|
129
|
+
window.addEventListener('touchend', onEndEvent, false);
|
130
|
+
window.addEventListener('touchcancel', onEndEvent, false);
|
131
|
+
}
|
132
|
+
|
133
|
+
list.el.on('mousedown', onStartEvent);
|
134
|
+
list.w.on('mousemove', onMoveEvent);
|
135
|
+
list.w.on('mouseup', onEndEvent);
|
136
|
+
|
137
|
+
},
|
138
|
+
|
139
|
+
serialize: function()
|
140
|
+
{
|
141
|
+
var data,
|
142
|
+
depth = 0,
|
143
|
+
list = this;
|
144
|
+
step = function(level, depth)
|
145
|
+
{
|
146
|
+
var array = [ ],
|
147
|
+
items = level.children(list.options.itemNodeName);
|
148
|
+
items.each(function()
|
149
|
+
{
|
150
|
+
var li = $(this),
|
151
|
+
item = $.extend({}, li.data()),
|
152
|
+
sub = li.children(list.options.listNodeName);
|
153
|
+
if (sub.length) {
|
154
|
+
item.children = step(sub, depth + 1);
|
155
|
+
}
|
156
|
+
array.push(item);
|
157
|
+
});
|
158
|
+
return array;
|
159
|
+
};
|
160
|
+
data = step(list.el.find(list.options.listNodeName).first(), depth);
|
161
|
+
return data;
|
162
|
+
},
|
163
|
+
|
164
|
+
serialise: function()
|
165
|
+
{
|
166
|
+
return this.serialize();
|
167
|
+
},
|
168
|
+
|
169
|
+
reset: function()
|
170
|
+
{
|
171
|
+
this.mouse = {
|
172
|
+
offsetX : 0,
|
173
|
+
offsetY : 0,
|
174
|
+
startX : 0,
|
175
|
+
startY : 0,
|
176
|
+
lastX : 0,
|
177
|
+
lastY : 0,
|
178
|
+
nowX : 0,
|
179
|
+
nowY : 0,
|
180
|
+
distX : 0,
|
181
|
+
distY : 0,
|
182
|
+
dirAx : 0,
|
183
|
+
dirX : 0,
|
184
|
+
dirY : 0,
|
185
|
+
lastDirX : 0,
|
186
|
+
lastDirY : 0,
|
187
|
+
distAxX : 0,
|
188
|
+
distAxY : 0
|
189
|
+
};
|
190
|
+
this.isTouch = false;
|
191
|
+
this.moving = false;
|
192
|
+
this.dragEl = null;
|
193
|
+
this.dragRootEl = null;
|
194
|
+
this.dragDepth = 0;
|
195
|
+
this.hasNewRoot = false;
|
196
|
+
this.pointEl = null;
|
197
|
+
},
|
198
|
+
|
199
|
+
expandItem: function(li)
|
200
|
+
{
|
201
|
+
li.removeClass(this.options.collapsedClass);
|
202
|
+
li.children('[data-action="expand"]').hide();
|
203
|
+
li.children('[data-action="collapse"]').show();
|
204
|
+
li.children(this.options.listNodeName).show();
|
205
|
+
},
|
206
|
+
|
207
|
+
collapseItem: function(li)
|
208
|
+
{
|
209
|
+
var lists = li.children(this.options.listNodeName);
|
210
|
+
if (lists.length) {
|
211
|
+
li.addClass(this.options.collapsedClass);
|
212
|
+
li.children('[data-action="collapse"]').hide();
|
213
|
+
li.children('[data-action="expand"]').show();
|
214
|
+
li.children(this.options.listNodeName).hide();
|
215
|
+
}
|
216
|
+
},
|
217
|
+
|
218
|
+
expandAll: function()
|
219
|
+
{
|
220
|
+
var list = this;
|
221
|
+
list.el.find(list.options.itemNodeName).each(function() {
|
222
|
+
list.expandItem($(this));
|
223
|
+
});
|
224
|
+
},
|
225
|
+
|
226
|
+
collapseAll: function()
|
227
|
+
{
|
228
|
+
var list = this;
|
229
|
+
list.el.find(list.options.itemNodeName).each(function() {
|
230
|
+
list.collapseItem($(this));
|
231
|
+
});
|
232
|
+
},
|
233
|
+
|
234
|
+
setParent: function(li)
|
235
|
+
{
|
236
|
+
if (li.children(this.options.listNodeName).length) {
|
237
|
+
li.prepend($(this.options.expandBtnHTML));
|
238
|
+
li.prepend($(this.options.collapseBtnHTML));
|
239
|
+
}
|
240
|
+
li.children('[data-action="expand"]').hide();
|
241
|
+
},
|
242
|
+
|
243
|
+
unsetParent: function(li)
|
244
|
+
{
|
245
|
+
li.removeClass(this.options.collapsedClass);
|
246
|
+
li.children('[data-action]').remove();
|
247
|
+
li.children(this.options.listNodeName).remove();
|
248
|
+
},
|
249
|
+
|
250
|
+
dragStart: function(e)
|
251
|
+
{
|
252
|
+
var mouse = this.mouse,
|
253
|
+
target = $(e.target),
|
254
|
+
dragItem = target.closest(this.options.itemNodeName);
|
255
|
+
|
256
|
+
this.placeEl.css('height', dragItem.height());
|
257
|
+
|
258
|
+
mouse.offsetX = e.offsetX !== undefined ? e.offsetX : e.pageX - target.offset().left;
|
259
|
+
mouse.offsetY = e.offsetY !== undefined ? e.offsetY : e.pageY - target.offset().top;
|
260
|
+
mouse.startX = mouse.lastX = e.pageX;
|
261
|
+
mouse.startY = mouse.lastY = e.pageY;
|
262
|
+
|
263
|
+
this.dragRootEl = this.el;
|
264
|
+
|
265
|
+
this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass);
|
266
|
+
this.dragEl.css('width', dragItem.width());
|
267
|
+
|
268
|
+
dragItem.after(this.placeEl);
|
269
|
+
dragItem[0].parentNode.removeChild(dragItem[0]);
|
270
|
+
dragItem.appendTo(this.dragEl);
|
271
|
+
|
272
|
+
$(document.body).append(this.dragEl);
|
273
|
+
this.dragEl.css({
|
274
|
+
'left' : e.pageX - mouse.offsetX,
|
275
|
+
'top' : e.pageY - mouse.offsetY
|
276
|
+
});
|
277
|
+
// total depth of dragging item
|
278
|
+
var i, depth,
|
279
|
+
items = this.dragEl.find(this.options.itemNodeName);
|
280
|
+
for (i = 0; i < items.length; i++) {
|
281
|
+
depth = $(items[i]).parents(this.options.listNodeName).length;
|
282
|
+
if (depth > this.dragDepth) {
|
283
|
+
this.dragDepth = depth;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
},
|
287
|
+
|
288
|
+
dragStop: function(e)
|
289
|
+
{
|
290
|
+
var el = this.dragEl.children(this.options.itemNodeName).first();
|
291
|
+
el[0].parentNode.removeChild(el[0]);
|
292
|
+
this.placeEl.replaceWith(el);
|
293
|
+
|
294
|
+
this.dragEl.remove();
|
295
|
+
this.el.trigger('change');
|
296
|
+
if (this.hasNewRoot) {
|
297
|
+
this.dragRootEl.trigger('change');
|
298
|
+
}
|
299
|
+
this.reset();
|
300
|
+
},
|
301
|
+
|
302
|
+
dragMove: function(e)
|
303
|
+
{
|
304
|
+
var list, parent, prev, next, depth,
|
305
|
+
opt = this.options,
|
306
|
+
mouse = this.mouse;
|
307
|
+
|
308
|
+
this.dragEl.css({
|
309
|
+
'left' : e.pageX - mouse.offsetX,
|
310
|
+
'top' : e.pageY - mouse.offsetY
|
311
|
+
});
|
312
|
+
|
313
|
+
// mouse position last events
|
314
|
+
mouse.lastX = mouse.nowX;
|
315
|
+
mouse.lastY = mouse.nowY;
|
316
|
+
// mouse position this events
|
317
|
+
mouse.nowX = e.pageX;
|
318
|
+
mouse.nowY = e.pageY;
|
319
|
+
// distance mouse moved between events
|
320
|
+
mouse.distX = mouse.nowX - mouse.lastX;
|
321
|
+
mouse.distY = mouse.nowY - mouse.lastY;
|
322
|
+
// direction mouse was moving
|
323
|
+
mouse.lastDirX = mouse.dirX;
|
324
|
+
mouse.lastDirY = mouse.dirY;
|
325
|
+
// direction mouse is now moving (on both axis)
|
326
|
+
mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1;
|
327
|
+
mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1;
|
328
|
+
// axis mouse is now moving on
|
329
|
+
var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0;
|
330
|
+
|
331
|
+
// do nothing on first move
|
332
|
+
if (!mouse.moving) {
|
333
|
+
mouse.dirAx = newAx;
|
334
|
+
mouse.moving = true;
|
335
|
+
return;
|
336
|
+
}
|
337
|
+
|
338
|
+
// calc distance moved on this axis (and direction)
|
339
|
+
if (mouse.dirAx !== newAx) {
|
340
|
+
mouse.distAxX = 0;
|
341
|
+
mouse.distAxY = 0;
|
342
|
+
} else {
|
343
|
+
mouse.distAxX += Math.abs(mouse.distX);
|
344
|
+
if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) {
|
345
|
+
mouse.distAxX = 0;
|
346
|
+
}
|
347
|
+
mouse.distAxY += Math.abs(mouse.distY);
|
348
|
+
if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) {
|
349
|
+
mouse.distAxY = 0;
|
350
|
+
}
|
351
|
+
}
|
352
|
+
mouse.dirAx = newAx;
|
353
|
+
|
354
|
+
/**
|
355
|
+
* move horizontal
|
356
|
+
*/
|
357
|
+
if (mouse.dirAx && mouse.distAxX >= opt.threshold) {
|
358
|
+
// reset move distance on x-axis for new phase
|
359
|
+
mouse.distAxX = 0;
|
360
|
+
prev = this.placeEl.prev(opt.itemNodeName);
|
361
|
+
// increase horizontal level if previous sibling exists and is not collapsed
|
362
|
+
if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) {
|
363
|
+
// cannot increase level when item above is collapsed
|
364
|
+
list = prev.find(opt.listNodeName).last();
|
365
|
+
// check if depth limit has reached
|
366
|
+
depth = this.placeEl.parents(opt.listNodeName).length;
|
367
|
+
if (depth + this.dragDepth <= opt.maxDepth) {
|
368
|
+
// create new sub-level if one doesn't exist
|
369
|
+
if (!list.length) {
|
370
|
+
list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass);
|
371
|
+
list.append(this.placeEl);
|
372
|
+
prev.append(list);
|
373
|
+
this.setParent(prev);
|
374
|
+
} else {
|
375
|
+
// else append to next level up
|
376
|
+
list = prev.children(opt.listNodeName).last();
|
377
|
+
list.append(this.placeEl);
|
378
|
+
}
|
379
|
+
}
|
380
|
+
}
|
381
|
+
// decrease horizontal level
|
382
|
+
if (mouse.distX < 0) {
|
383
|
+
// we can't decrease a level if an item preceeds the current one
|
384
|
+
next = this.placeEl.next(opt.itemNodeName);
|
385
|
+
if (!next.length) {
|
386
|
+
parent = this.placeEl.parent();
|
387
|
+
this.placeEl.closest(opt.itemNodeName).after(this.placeEl);
|
388
|
+
if (!parent.children().length) {
|
389
|
+
this.unsetParent(parent.parent());
|
390
|
+
}
|
391
|
+
}
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
395
|
+
var isEmpty = false;
|
396
|
+
|
397
|
+
// find list item under cursor
|
398
|
+
if (!hasPointerEvents) {
|
399
|
+
this.dragEl[0].style.visibility = 'hidden';
|
400
|
+
}
|
401
|
+
this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop)));
|
402
|
+
if (!hasPointerEvents) {
|
403
|
+
this.dragEl[0].style.visibility = 'visible';
|
404
|
+
}
|
405
|
+
if (this.pointEl.hasClass(opt.handleClass)) {
|
406
|
+
this.pointEl = this.pointEl.parent(opt.itemNodeName);
|
407
|
+
}
|
408
|
+
if (this.pointEl.hasClass(opt.emptyClass)) {
|
409
|
+
isEmpty = true;
|
410
|
+
}
|
411
|
+
else if (!this.pointEl.length || !this.pointEl.hasClass(opt.itemClass)) {
|
412
|
+
return;
|
413
|
+
}
|
414
|
+
|
415
|
+
// find parent list of item under cursor
|
416
|
+
var pointElRoot = this.pointEl.closest('.' + opt.rootClass),
|
417
|
+
isNewRoot = this.dragRootEl.data('nestable-id') !== pointElRoot.data('nestable-id');
|
418
|
+
|
419
|
+
/**
|
420
|
+
* move vertical
|
421
|
+
*/
|
422
|
+
if (!mouse.dirAx || isNewRoot || isEmpty) {
|
423
|
+
// check if groups match if dragging over new root
|
424
|
+
if (isNewRoot && opt.group !== pointElRoot.data('nestable-group')) {
|
425
|
+
return;
|
426
|
+
}
|
427
|
+
// check depth limit
|
428
|
+
depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length;
|
429
|
+
if (depth > opt.maxDepth) {
|
430
|
+
return;
|
431
|
+
}
|
432
|
+
var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2);
|
433
|
+
parent = this.placeEl.parent();
|
434
|
+
// if empty create new list to replace empty placeholder
|
435
|
+
if (isEmpty) {
|
436
|
+
list = $(document.createElement(opt.listNodeName)).addClass(opt.listClass);
|
437
|
+
list.append(this.placeEl);
|
438
|
+
this.pointEl.replaceWith(list);
|
439
|
+
}
|
440
|
+
else if (before) {
|
441
|
+
this.pointEl.before(this.placeEl);
|
442
|
+
}
|
443
|
+
else {
|
444
|
+
this.pointEl.after(this.placeEl);
|
445
|
+
}
|
446
|
+
if (!parent.children().length) {
|
447
|
+
this.unsetParent(parent.parent());
|
448
|
+
}
|
449
|
+
if (!this.dragRootEl.find(opt.itemNodeName).length) {
|
450
|
+
this.dragRootEl.append('<div class="' + opt.emptyClass + '"/>');
|
451
|
+
}
|
452
|
+
// parent root list has changed
|
453
|
+
if (isNewRoot) {
|
454
|
+
this.dragRootEl = pointElRoot;
|
455
|
+
this.hasNewRoot = this.el[0] !== this.dragRootEl[0];
|
456
|
+
}
|
457
|
+
}
|
458
|
+
}
|
459
|
+
|
460
|
+
};
|
461
|
+
|
462
|
+
$.fn.nestable = function(params)
|
463
|
+
{
|
464
|
+
var lists = this,
|
465
|
+
retval = this;
|
466
|
+
|
467
|
+
lists.each(function()
|
468
|
+
{
|
469
|
+
var plugin = $(this).data("nestable");
|
470
|
+
|
471
|
+
if (!plugin) {
|
472
|
+
$(this).data("nestable", new Plugin(this, params));
|
473
|
+
$(this).data("nestable-id", new Date().getTime());
|
474
|
+
} else {
|
475
|
+
if (typeof params === 'string' && typeof plugin[params] === 'function') {
|
476
|
+
retval = plugin[params]();
|
477
|
+
}
|
478
|
+
}
|
479
|
+
});
|
480
|
+
|
481
|
+
return retval || lists;
|
482
|
+
};
|
483
|
+
|
484
|
+
})(window.jQuery || window.Zepto, window, document);
|
@@ -0,0 +1,4 @@
|
|
1
|
+
(function(a){var c,e=a();a.fn.sortable=function(b){var k=String(b);b=a.extend({connectWith:!1},b);return this.each(function(){if(/^enable|disable|destroy$/.test(k)){var g=a(this).children(a(this).data("items")).attr("draggable","enable"==k);"destroy"==k&&g.add(this).removeData("connectWith items").off("dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s")}else{var h,l,g=a(this).children(b.items),f=a("<"+(/^ul|ol$/i.test(this.tagName)?"li":/^tbody$/i.test(this.tagName)?"tr":
|
2
|
+
"div")+' class="sortable-placeholder '+b.placeholderClass+'">').html(" ");g.find(b.handle).mousedown(function(){h=!0}).mouseup(function(){h=!1});a(this).data("items",b.items);e=e.add(f);b.connectWith&&a(b.connectWith).add(this).data("connectWith",b.connectWith);g.attr("draggable","true").on("dragstart.h5s",function(d){if(b.handle&&!h)return!1;h=!1;d=d.originalEvent.dataTransfer;d.effectAllowed="move";d.setData("Text","dummy");l=(c=a(this)).addClass("sortable-dragging").index()}).on("dragend.h5s",
|
3
|
+
function(){c&&(c.removeClass("sortable-dragging").show(),e.detach(),l!=c.index()&&c.parent().trigger("sortupdate",{item:c}),c=null)}).not("a[href], img").on("selectstart.h5s",function(){this.dragDrop&&this.dragDrop();return!1}).end().add([this,f]).on("dragover.h5s dragenter.h5s drop.h5s",function(d){if(!g.is(c)&&b.connectWith!==a(c).parent().data("connectWith"))return!0;if("drop"==d.type)return d.stopPropagation(),e.filter(":visible").after(c),c.trigger("dragend.h5s"),!1;d.preventDefault();d.originalEvent.dataTransfer.dropEffect=
|
4
|
+
"move";g.is(this)?(b.forcePlaceholderSize&&f.height(c.outerHeight()),c.hide(),a(this)[f.index()<a(this).index()?"after":"before"](f),e.not(f).detach()):e.is(this)||a(this).children(b.items).length||(e.detach(),a(this).append(f));return!1})}})}})(jQuery);
|
@@ -0,0 +1,61 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
//= require jquery.sortable.min
|
4
|
+
//= require jquery.nestable
|
5
|
+
|
6
|
+
; (function ($, window, document, undefined) {
|
7
|
+
$('.inputfile').each(function () {
|
8
|
+
var $input = $(this),
|
9
|
+
$label = $input.next('label'),
|
10
|
+
labelVal = $label.html();
|
11
|
+
|
12
|
+
$input.on('change', function (e) {
|
13
|
+
var fileName = '';
|
14
|
+
|
15
|
+
if (this.files && this.files.length > 1)
|
16
|
+
fileName = (this.getAttribute('data-multiple-caption') || '').replace('{count}', this.files.length);
|
17
|
+
else if (e.target.value)
|
18
|
+
fileName = e.target.value.split('\\').pop();
|
19
|
+
|
20
|
+
if (fileName)
|
21
|
+
$label.find('span').html(fileName);
|
22
|
+
else
|
23
|
+
$label.html(labelVal);
|
24
|
+
});
|
25
|
+
|
26
|
+
// Firefox bug fix
|
27
|
+
$input
|
28
|
+
.on('focus', function () { $input.addClass('has-focus'); })
|
29
|
+
.on('blur', function () { $input.removeClass('has-focus'); });
|
30
|
+
});
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
})(jQuery, window, document);
|
36
|
+
|
37
|
+
|
38
|
+
$(function() {
|
39
|
+
// Sidebar toggle
|
40
|
+
$("#sidebar-toggle").click(function (e) {
|
41
|
+
e.preventDefault();
|
42
|
+
$("#wrapper").toggleClass("toggled");
|
43
|
+
});
|
44
|
+
|
45
|
+
// Enable Tooltips
|
46
|
+
$(function () {
|
47
|
+
$('[data-toggle="tooltip"]').tooltip()
|
48
|
+
})
|
49
|
+
|
50
|
+
// Enable Popovers
|
51
|
+
$(function () {
|
52
|
+
$('[data-toggle="popover"]').popover()
|
53
|
+
})
|
54
|
+
|
55
|
+
// Bootstrap button dropdown inside responsive table not visible because of scroll
|
56
|
+
// http://stackoverflow.com/questions/26018756/bootstrap-button-drop-down-inside-responsive-table-not-visible-because-of-scroll
|
57
|
+
$('body').on('show.bs.dropdown', '.table-responsive', function () { $(this).css("overflow", "visible"); })
|
58
|
+
.on('hide.bs.dropdown', '.table-responsive', function () { $(this).css("overflow", "auto"); });
|
59
|
+
|
60
|
+
});
|
61
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#header-navbar {
|
2
|
+
height: $header-navbar-height;
|
3
|
+
padding: $spacer/2 $spacer $spacer/2 0;
|
4
|
+
background: $header-navbar-bg;
|
5
|
+
border-bottom: 1px solid $header-navbar-bottom-border;
|
6
|
+
-webkit-transform-style: preserve-3d;
|
7
|
+
-moz-transform-style: preserve-3d;
|
8
|
+
transform-style: preserve-3d;
|
9
|
+
font-size: 0.9em;
|
10
|
+
|
11
|
+
// sidebar toggle
|
12
|
+
#sidebar-toggle {
|
13
|
+
position: absolute;
|
14
|
+
top: 0;
|
15
|
+
bottom: -1px;
|
16
|
+
left: 0;
|
17
|
+
padding: 0 $spacer;
|
18
|
+
border-radius: 0;
|
19
|
+
outline: 0 !important;
|
20
|
+
}
|
21
|
+
|
22
|
+
.navbar-brand {
|
23
|
+
display: none;
|
24
|
+
position: absolute;
|
25
|
+
top: 50%;
|
26
|
+
left: 50%;
|
27
|
+
@include transform(translate(-50%, -50%));
|
28
|
+
width: 25%;
|
29
|
+
height: 65%;
|
30
|
+
background: transparent url($header-navbar-logotype) no-repeat center center;
|
31
|
+
background-size: contain;
|
32
|
+
|
33
|
+
@include media-breakpoint-down(sm) {
|
34
|
+
display: block;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
.btn-group {
|
39
|
+
position: absolute;
|
40
|
+
top: 0;
|
41
|
+
right: $spacer;
|
42
|
+
height: 100%;
|
43
|
+
|
44
|
+
.btn {
|
45
|
+
height: 100%;
|
46
|
+
padding: 0;
|
47
|
+
font-size: 1rem;
|
48
|
+
|
49
|
+
@include media-breakpoint-down(sm) {
|
50
|
+
padding: 0 $spacer;
|
51
|
+
|
52
|
+
i { font-size: 1.25rem; }
|
53
|
+
|
54
|
+
&:after {
|
55
|
+
display: none;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
}
|