layerpro 0.0.62 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/popup.jsx +47 -39
package/package.json
CHANGED
package/scripts/popup.jsx
CHANGED
|
@@ -19,7 +19,7 @@ $.ajaxSetup({
|
|
|
19
19
|
|
|
20
20
|
const larX = 300
|
|
21
21
|
const larY = 150
|
|
22
|
-
|
|
22
|
+
const prefs = localStorage.getItem('layerpro')
|
|
23
23
|
|
|
24
24
|
let isdresizableRes
|
|
25
25
|
let highIndex = 1
|
|
@@ -46,7 +46,7 @@ export const popup = {
|
|
|
46
46
|
if (!p) return false
|
|
47
47
|
|
|
48
48
|
p.id = p.id || Math.round(Math.random() * 1000)
|
|
49
|
-
p.body = p.body
|
|
49
|
+
p.body = p.body
|
|
50
50
|
p.width = p.width || 640
|
|
51
51
|
p.height = p.height || 480
|
|
52
52
|
p.name = p.name || 'popUp_' + p.id
|
|
@@ -55,7 +55,7 @@ export const popup = {
|
|
|
55
55
|
p.iconize = p.iconize || null
|
|
56
56
|
p.maximize = p.maximize || null
|
|
57
57
|
p.isMaximize = p.isMaximize || null
|
|
58
|
-
p.dockable = p.dockable
|
|
58
|
+
p.dockable = p.dockable
|
|
59
59
|
p.close = p.close || null
|
|
60
60
|
p.raised = p.raised || null
|
|
61
61
|
p.movable = p.movable || null
|
|
@@ -355,8 +355,8 @@ export const popup = {
|
|
|
355
355
|
function dragMouseDown(e) {
|
|
356
356
|
pos3 = e.clientX
|
|
357
357
|
pos4 = e.clientY
|
|
358
|
-
document.
|
|
359
|
-
document.
|
|
358
|
+
document.onmousemove = elementDrag
|
|
359
|
+
document.onmouseup = elementDragEnd
|
|
360
360
|
return false
|
|
361
361
|
}
|
|
362
362
|
|
|
@@ -423,8 +423,8 @@ export const popup = {
|
|
|
423
423
|
|
|
424
424
|
popup.vfx(_parent, false)
|
|
425
425
|
|
|
426
|
-
document.
|
|
427
|
-
document.
|
|
426
|
+
document.onmousemove = (e) => { popup.doRes(e, id) }
|
|
427
|
+
document.onmouseup = () => { popup.stopRes(id) }
|
|
428
428
|
|
|
429
429
|
startX = cords[0]
|
|
430
430
|
startY = cords[1]
|
|
@@ -463,27 +463,35 @@ export const popup = {
|
|
|
463
463
|
/********************************************************************************************************************************************/
|
|
464
464
|
|
|
465
465
|
// TOP DRAG
|
|
466
|
-
if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1
|
|
467
|
-
if (
|
|
468
|
-
|
|
466
|
+
if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) {
|
|
467
|
+
if (_sizer.hasClass("resize_0")) {
|
|
468
|
+
if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
|
|
469
|
+
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
|
|
470
|
+
}
|
|
469
471
|
}
|
|
470
472
|
|
|
471
|
-
if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1
|
|
472
|
-
|
|
473
|
-
if (
|
|
474
|
-
|
|
473
|
+
if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) {
|
|
474
|
+
// RIGHT DRAG
|
|
475
|
+
if (_sizer.hasClass("resize_1")) {
|
|
476
|
+
if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
|
|
477
|
+
if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
|
|
478
|
+
}
|
|
475
479
|
}
|
|
476
480
|
|
|
477
|
-
if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1
|
|
478
|
-
|
|
479
|
-
if (
|
|
480
|
-
|
|
481
|
+
if (popup.checkArea(e)[1] < popup.checkArea(e)[4] && Math.sign(popup.checkArea(e)[1]) === 1) {
|
|
482
|
+
// BOTTOM DRAG
|
|
483
|
+
if (_sizer.hasClass("resize_2")) {
|
|
484
|
+
if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
|
|
485
|
+
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
|
|
486
|
+
}
|
|
481
487
|
}
|
|
482
488
|
|
|
483
|
-
if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1
|
|
484
|
-
|
|
485
|
-
if (
|
|
486
|
-
|
|
489
|
+
if (popup.checkArea(e)[0] < popup.checkArea(e)[5] && Math.sign(popup.checkArea(e)[0]) === 1) {
|
|
490
|
+
// LEFT DRAG
|
|
491
|
+
if (_sizer.hasClass("resize_3")) {
|
|
492
|
+
if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
|
|
493
|
+
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
|
|
494
|
+
}
|
|
487
495
|
}
|
|
488
496
|
|
|
489
497
|
/********************************************************************************************************************************************/
|
|
@@ -497,34 +505,34 @@ export const popup = {
|
|
|
497
505
|
|
|
498
506
|
// TOP LEFT
|
|
499
507
|
if (_sizer.hasClass("resize_corner_0")) {
|
|
500
|
-
if (_parent.height() >= larY) { _parent.css({ 'top':
|
|
501
|
-
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height':
|
|
502
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
503
|
-
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width':
|
|
508
|
+
if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
|
|
509
|
+
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
|
|
510
|
+
if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
|
|
511
|
+
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
|
|
504
512
|
}
|
|
505
513
|
|
|
506
514
|
// TOP RIGHT
|
|
507
515
|
if (_sizer.hasClass("resize_corner_1")) {
|
|
508
|
-
if (_parent.height() >= larY) { _parent.css({ 'top':
|
|
509
|
-
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height':
|
|
510
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
511
|
-
if (_parent.width() <= larX) { _parent.css({ 'width':
|
|
516
|
+
if (_parent.height() >= larY) { _parent.css({ 'top': parseInt(startBottom - Y1), 'height': parseInt(Y1) }) }
|
|
517
|
+
if (_parent.height() <= larY && Y1 > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
|
|
518
|
+
if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
|
|
519
|
+
if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
|
|
512
520
|
}
|
|
513
521
|
|
|
514
522
|
// BOTTOM RIGHT
|
|
515
523
|
if (_sizer.hasClass("resize_corner_2")) {
|
|
516
|
-
if (_parent.height() >= larY) { _parent.css({ 'height':
|
|
517
|
-
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height':
|
|
518
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
519
|
-
if (_parent.width() <= larX) { _parent.css({ 'width':
|
|
524
|
+
if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
|
|
525
|
+
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
|
|
526
|
+
if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X), 'right': parseInt(startLeft - X) }) }
|
|
527
|
+
if (_parent.width() <= larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
|
|
520
528
|
}
|
|
521
529
|
|
|
522
530
|
// BOTTOM LEFT
|
|
523
531
|
if (_sizer.hasClass("resize_corner_3")) {
|
|
524
|
-
if (_parent.height() >= larY) { _parent.css({ 'height':
|
|
525
|
-
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height':
|
|
526
|
-
if (_parent.width() >= larX) { _parent.css({ 'width':
|
|
527
|
-
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width':
|
|
532
|
+
if (_parent.height() >= larY) { _parent.css({ 'height': parseInt(Y) }) }
|
|
533
|
+
if (_parent.height() <= larY && Y > larY) { _parent.css({ 'height': parseInt(larY + 1) }) }
|
|
534
|
+
if (_parent.width() >= larX) { _parent.css({ 'width': parseInt(X1), 'left': parseInt(startRight - X1) }) }
|
|
535
|
+
if (_parent.width() <= larX && X1 > larX) { _parent.css({ 'width': parseInt(larX + 1) }) }
|
|
528
536
|
}
|
|
529
537
|
|
|
530
538
|
}
|
|
@@ -584,7 +592,7 @@ export const popup = {
|
|
|
584
592
|
zIndex: function (els) {
|
|
585
593
|
|
|
586
594
|
els.each(function () {
|
|
587
|
-
let currentIndex =
|
|
595
|
+
let currentIndex = parseInt($(this, '#popup').css("zIndex"), 10)
|
|
588
596
|
|
|
589
597
|
if (currentIndex > highIndex) {
|
|
590
598
|
highIndex = currentIndex
|