From 9d4eb3d4d604246a4fc43b7a90e1ee864006ffca Mon Sep 17 00:00:00 2001 From: adumesny Date: Wed, 13 Sep 2017 10:12:09 -0700 Subject: [PATCH 1/3] instead generate the output files during build process, so there is no conflict on merge or issue being out of sync. use 'build' target to generate before publishing npm (which I didn't see included) Bug Number: https://github.com/gridstack/gridstack.js/issues/776 --- .gitignore | 1 + dist/gridstack-extra.css | 1295 ----------------------- dist/gridstack-extra.min.css | 1 - dist/gridstack.all.js | 17 - dist/gridstack.css | 387 ------- dist/gridstack.jQueryUI.js | 95 -- dist/gridstack.jQueryUI.min.js | 9 - dist/gridstack.js | 1785 -------------------------------- dist/gridstack.min.css | 1 - dist/gridstack.min.js | 10 - dist/gridstack.min.map | 1 - package.json | 6 +- 12 files changed, 5 insertions(+), 3603 deletions(-) delete mode 100644 dist/gridstack-extra.css delete mode 100644 dist/gridstack-extra.min.css delete mode 100644 dist/gridstack.all.js delete mode 100644 dist/gridstack.css delete mode 100644 dist/gridstack.jQueryUI.js delete mode 100644 dist/gridstack.jQueryUI.min.js delete mode 100644 dist/gridstack.js delete mode 100644 dist/gridstack.min.css delete mode 100644 dist/gridstack.min.js delete mode 100644 dist/gridstack.min.map diff --git a/.gitignore b/.gitignore index 95ec03ef6..a3e22fcb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +dist node_modules bower_components coverage diff --git a/dist/gridstack-extra.css b/dist/gridstack-extra.css deleted file mode 100644 index 0f51e59b4..000000000 --- a/dist/gridstack-extra.css +++ /dev/null @@ -1,1295 +0,0 @@ -.grid-stack.grid-stack-1 > .grid-stack-item { - min-width: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-width='1'] { - width: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-x='1'] { - left: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item { - min-width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='1'] { - width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='1'] { - left: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='2'] { - width: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='2'] { - left: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='1'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='1'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='2'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='2'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='3'] { - width: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='3'] { - left: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item { - min-width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='1'] { - width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='1'] { - left: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='2'] { - width: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='2'] { - left: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='3'] { - width: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='3'] { - left: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='4'] { - width: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='4'] { - left: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item { - min-width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='1'] { - width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='1'] { - left: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='2'] { - width: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='2'] { - left: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='3'] { - width: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='3'] { - left: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='4'] { - width: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='4'] { - left: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='5'] { - width: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='5'] { - left: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item { - min-width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='1'] { - width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='1'] { - left: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='2'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='2'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='3'] { - width: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='3'] { - left: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='4'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='4'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='5'] { - width: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='5'] { - left: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='6'] { - width: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='6'] { - left: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item { - min-width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='1'] { - width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='1'] { - left: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='2'] { - width: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='2'] { - left: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='3'] { - width: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='3'] { - left: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='4'] { - width: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='4'] { - left: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='5'] { - width: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='5'] { - left: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='6'] { - width: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='6'] { - left: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='7'] { - width: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='7'] { - left: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item { - min-width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='1'] { - width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='1'] { - left: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='2'] { - width: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='2'] { - left: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='3'] { - width: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='3'] { - left: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='4'] { - width: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='4'] { - left: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='5'] { - width: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='5'] { - left: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='6'] { - width: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='6'] { - left: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='7'] { - width: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='7'] { - left: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='8'] { - width: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='8'] { - left: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item { - min-width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='1'] { - width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='1'] { - left: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='2'] { - width: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='2'] { - left: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='3'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='3'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='4'] { - width: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='4'] { - left: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='5'] { - width: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='5'] { - left: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='6'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='6'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='7'] { - width: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='7'] { - left: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='8'] { - width: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='8'] { - left: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='9'] { - width: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='9'] { - left: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item { - min-width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='1'] { - width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='1'] { - left: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='2'] { - width: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='2'] { - left: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='3'] { - width: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='3'] { - left: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='4'] { - width: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='4'] { - left: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='5'] { - width: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='5'] { - left: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='6'] { - width: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='6'] { - left: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='7'] { - width: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='7'] { - left: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='8'] { - width: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='8'] { - left: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='9'] { - width: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='9'] { - left: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='10'] { - width: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='10'] { - left: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item { - min-width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='1'] { - width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='1'] { - left: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='2'] { - width: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='2'] { - left: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='3'] { - width: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='3'] { - left: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='4'] { - width: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='4'] { - left: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='5'] { - width: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='5'] { - left: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='6'] { - width: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='6'] { - left: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='7'] { - width: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='7'] { - left: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='8'] { - width: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='8'] { - left: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='9'] { - width: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='9'] { - left: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='10'] { - width: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='10'] { - left: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='11'] { - width: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='11'] { - left: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='11'] { - min-width: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='11'] { - max-width: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item { - min-width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='1'] { - width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='1'] { - left: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='2'] { - width: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='2'] { - left: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='3'] { - width: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='3'] { - left: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='4'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='4'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='5'] { - width: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='5'] { - left: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='6'] { - width: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='6'] { - left: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='7'] { - width: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='7'] { - left: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='8'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='8'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='9'] { - width: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='9'] { - left: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='10'] { - width: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='10'] { - left: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='11'] { - width: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='11'] { - left: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='11'] { - min-width: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='11'] { - max-width: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='12'] { - width: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='12'] { - left: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='12'] { - min-width: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='12'] { - max-width: 100%; -} diff --git a/dist/gridstack-extra.min.css b/dist/gridstack-extra.min.css deleted file mode 100644 index 8a29cc21d..000000000 --- a/dist/gridstack-extra.min.css +++ /dev/null @@ -1 +0,0 @@ -.grid-stack.grid-stack-1>.grid-stack-item{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-width='1']{width:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-x='1']{left:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-min-width='1']{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-max-width='1']{max-width:100%}.grid-stack.grid-stack-2>.grid-stack-item{min-width:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-width='1']{width:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-x='1']{left:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-min-width='1']{min-width:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-max-width='1']{max-width:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-width='2']{width:100%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-x='2']{left:100%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-min-width='2']{min-width:100%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-max-width='2']{max-width:100%}.grid-stack.grid-stack-3>.grid-stack-item{min-width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='1']{width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='1']{left:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='1']{min-width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='1']{max-width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='2']{width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='2']{left:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='2']{min-width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='2']{max-width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='3']{width:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='3']{left:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='3']{min-width:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='3']{max-width:100%}.grid-stack.grid-stack-4>.grid-stack-item{min-width:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='1']{width:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='1']{left:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='1']{min-width:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='1']{max-width:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='2']{width:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='2']{left:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='2']{min-width:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='2']{max-width:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='3']{width:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='3']{left:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='3']{min-width:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='3']{max-width:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='4']{width:100%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='4']{left:100%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='4']{min-width:100%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='4']{max-width:100%}.grid-stack.grid-stack-5>.grid-stack-item{min-width:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='1']{width:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='1']{left:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='1']{min-width:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='1']{max-width:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='2']{width:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='2']{left:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='2']{min-width:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='2']{max-width:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='3']{width:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='3']{left:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='3']{min-width:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='3']{max-width:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='4']{width:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='4']{left:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='4']{min-width:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='4']{max-width:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='5']{width:100%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='5']{left:100%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='5']{min-width:100%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='5']{max-width:100%}.grid-stack.grid-stack-6>.grid-stack-item{min-width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='1']{width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='1']{left:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='1']{min-width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='1']{max-width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='2']{width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='2']{left:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='2']{min-width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='2']{max-width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='3']{width:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='3']{left:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='3']{min-width:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='3']{max-width:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='4']{width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='4']{left:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='4']{min-width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='4']{max-width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='5']{width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='5']{left:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='5']{min-width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='5']{max-width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='6']{width:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='6']{left:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='6']{min-width:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='6']{max-width:100%}.grid-stack.grid-stack-7>.grid-stack-item{min-width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='1']{width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='1']{left:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='1']{min-width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='1']{max-width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='2']{width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='2']{left:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='2']{min-width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='2']{max-width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='3']{width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='3']{left:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='3']{min-width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='3']{max-width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='4']{width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='4']{left:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='4']{min-width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='4']{max-width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='5']{width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='5']{left:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='5']{min-width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='5']{max-width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='6']{width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='6']{left:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='6']{min-width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='6']{max-width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='7']{width:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='7']{left:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='7']{min-width:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='7']{max-width:100%}.grid-stack.grid-stack-8>.grid-stack-item{min-width:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='1']{width:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='1']{left:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='1']{min-width:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='1']{max-width:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='2']{width:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='2']{left:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='2']{min-width:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='2']{max-width:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='3']{width:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='3']{left:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='3']{min-width:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='3']{max-width:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='4']{width:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='4']{left:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='4']{min-width:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='4']{max-width:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='5']{width:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='5']{left:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='5']{min-width:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='5']{max-width:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='6']{width:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='6']{left:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='6']{min-width:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='6']{max-width:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='7']{width:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='7']{left:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='7']{min-width:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='7']{max-width:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='8']{width:100%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='8']{left:100%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='8']{min-width:100%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='8']{max-width:100%}.grid-stack.grid-stack-9>.grid-stack-item{min-width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='1']{width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='1']{left:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='1']{min-width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='1']{max-width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='2']{width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='2']{left:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='2']{min-width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='2']{max-width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='3']{width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='3']{left:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='3']{min-width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='3']{max-width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='4']{width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='4']{left:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='4']{min-width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='4']{max-width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='5']{width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='5']{left:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='5']{min-width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='5']{max-width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='6']{width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='6']{left:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='6']{min-width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='6']{max-width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='7']{width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='7']{left:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='7']{min-width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='7']{max-width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='8']{width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='8']{left:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='8']{min-width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='8']{max-width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='9']{width:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='9']{left:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='9']{min-width:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='9']{max-width:100%}.grid-stack.grid-stack-10>.grid-stack-item{min-width:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='1']{width:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='1']{left:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='1']{min-width:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='1']{max-width:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='2']{width:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='2']{left:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='2']{min-width:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='2']{max-width:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='3']{width:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='3']{left:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='3']{min-width:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='3']{max-width:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='4']{width:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='4']{left:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='4']{min-width:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='4']{max-width:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='5']{width:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='5']{left:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='5']{min-width:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='5']{max-width:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='6']{width:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='6']{left:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='6']{min-width:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='6']{max-width:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='7']{width:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='7']{left:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='7']{min-width:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='7']{max-width:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='8']{width:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='8']{left:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='8']{min-width:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='8']{max-width:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='9']{width:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='9']{left:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='9']{min-width:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='9']{max-width:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='10']{width:100%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='10']{left:100%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='10']{min-width:100%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='10']{max-width:100%}.grid-stack.grid-stack-11>.grid-stack-item{min-width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='1']{width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='1']{left:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='1']{min-width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='1']{max-width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='2']{width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='2']{left:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='2']{min-width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='2']{max-width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='3']{width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='3']{left:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='3']{min-width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='3']{max-width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='4']{width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='4']{left:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='4']{min-width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='4']{max-width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='5']{width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='5']{left:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='5']{min-width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='5']{max-width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='6']{width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='6']{left:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='6']{min-width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='6']{max-width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='7']{width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='7']{left:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='7']{min-width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='7']{max-width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='8']{width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='8']{left:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='8']{min-width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='8']{max-width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='9']{width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='9']{left:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='9']{min-width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='9']{max-width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='10']{width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='10']{left:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='10']{min-width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='10']{max-width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='11']{width:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='11']{left:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='11']{min-width:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='11']{max-width:100%}.grid-stack.grid-stack-12>.grid-stack-item{min-width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='1']{width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='3']{width:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='3']{left:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='3']{min-width:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='3']{max-width:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='4']{width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='6']{width:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='6']{left:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='6']{min-width:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='6']{max-width:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='7']{width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='9']{width:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='9']{left:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='9']{min-width:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='9']{max-width:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='10']{width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='12']{width:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='12']{left:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='12']{min-width:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='12']{max-width:100%} \ No newline at end of file diff --git a/dist/gridstack.all.js b/dist/gridstack.all.js deleted file mode 100644 index ee40065a8..000000000 --- a/dist/gridstack.all.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(a){}try{_=require("lodash")}catch(a){}a(jQuery,_)}else a(jQuery,_)}(function(a,b){function c(a){this.grid=a}var d=window,e=function(a,b,c){var d=function(){return console.warn("gridstack.js: Function `"+b+"` is deprecated as of v0.2.5 and has been replaced with `"+c+"`. It will be **completely** removed in v1.0."),a.apply(this,arguments)};return d.prototype=a.prototype,d},f=function(a,b){console.warn("gridstack.js: Option `"+a+"` is deprecated as of v0.2.5 and has been replaced with `"+b+"`. It will be **completely** removed in v1.0.")},g={isIntercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(a,c,d){return d=d||b.chain(a).map(function(a){return a.x+a.width}).max().value(),c=-1!=c?1:-1,b.sortBy(a,function(a){return c*(a.x+a.y*d)})},createStylesheet:function(a){var b=document.createElement("style");return b.setAttribute("type","text/css"),b.setAttribute("data-gs-style-id",a),b.styleSheet?b.styleSheet.cssText="":b.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(b),b.sheet},removeStylesheet:function(b){a("STYLE[data-gs-style-id="+b+"]").remove()},insertCSSRule:function(a,b,c,d){"function"==typeof a.insertRule?a.insertRule(b+"{"+c+"}",d):"function"==typeof a.addRule&&a.addRule(b,c,d)},toBool:function(a){return"boolean"==typeof a?a:"string"==typeof a?!(""===(a=a.toLowerCase())||"no"==a||"false"==a||"0"==a):Boolean(a)},_collisionNodeCheck:function(a){return a!=this.node&&g.isIntercepted(a,this.nn)},_didCollide:function(a){return g.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_isAddNodeIntercepted:function(a){return g.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},a)},parseHeight:function(a){var c=a,d="px";if(c&&b.isString(c)){var e=c.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!e)throw new Error("Invalid height");d=e[2]||"px",c=parseFloat(e[1])}return{height:c,unit:d}},removePositioningStyles:function(a){var b=a[0].style;b.position&&b.removeProperty("position"),b.left&&b.removeProperty("left"),b.top&&b.removeProperty("top"),b.width&&b.removeProperty("width"),b.height&&b.removeProperty("height")}};g.is_intercepted=e(g.isIntercepted,"is_intercepted","isIntercepted"),g.create_stylesheet=e(g.createStylesheet,"create_stylesheet","createStylesheet"),g.remove_stylesheet=e(g.removeStylesheet,"remove_stylesheet","removeStylesheet"),g.insert_css_rule=e(g.insertCSSRule,"insert_css_rule","insertCSSRule"),c.registeredPlugins=[],c.registerPlugin=function(a){c.registeredPlugins.push(a)},c.prototype.resizable=function(a,b){return this},c.prototype.draggable=function(a,b){return this},c.prototype.droppable=function(a,b){return this},c.prototype.isDroppable=function(a){return!1},c.prototype.on=function(a,b,c){return this};var h=0,i=function(a,b,c,d,e){this.width=a,this.float=c||!1,this.height=d||0,this.nodes=e||[],this.onchange=b||function(){},this._updateCounter=0,this._float=this.float,this._addedNodes=[],this._removedNodes=[]};i.prototype.batchUpdate=function(){this._updateCounter=1,this.float=!0},i.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this.float=this._float,this._packNodes(),this._notify())},i.prototype.getNodeDataByDOMEl=function(a){return b.find(this.nodes,function(b){return a.get(0)===b.el.get(0)})},i.prototype._fixCollisions=function(a){this._sortNodes(-1);var c=a,d=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this.float||d||(c={x:0,y:a.y,width:this.width,height:a.height});;){var e=b.find(this.nodes,b.bind(g._collisionNodeCheck,{node:a,nn:c}));if(void 0===e)return;this.moveNode(e,e.x,a.y+a.height,e.width,e.height,!0)}},i.prototype.isAreaEmpty=function(a,c,d,e){var f={x:a||0,y:c||0,width:d||1,height:e||1},h=b.find(this.nodes,b.bind(function(a){return g.isIntercepted(a,f)},this));return null===h||void 0===h},i.prototype._sortNodes=function(a){this.nodes=g.sort(this.nodes,a,this.width)},i.prototype._packNodes=function(){this._sortNodes(),this.float?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&void 0!==a._origY&&a.y!=a._origY)for(var d=a.y;d>=a._origY;){var e=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e||(a._dirty=!0,a.y=d),--d}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var d=a.y-1,e=0===c;if(c>0){var f=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e=void 0===f}if(!e)break;a._dirty=a.y!=d,a.y=d}},this))},i.prototype._prepareNode=function(a,c){return a=b.defaults(a||{},{width:1,height:1,x:0,y:0}),a.x=parseInt(""+a.x),a.y=parseInt(""+a.y),a.width=parseInt(""+a.width),a.height=parseInt(""+a.height),a.autoPosition=a.autoPosition||!1,a.noResize=a.noResize||!1,a.noMove=a.noMove||!1,a.width>this.width?a.width=this.width:a.width<1&&(a.width=1),a.height<1&&(a.height=1),a.x<0&&(a.x=0),a.x+a.width>this.width&&(c?a.width=this.width-a.x:a.x=this.width-a.width),a.y<0&&(a.y=0),a},i.prototype._notify=function(){var a=Array.prototype.slice.call(arguments,0);if(a[0]=void 0===a[0]?[]:[a[0]],a[1]=void 0===a[1]||a[1],!this._updateCounter){var b=a[0].concat(this.getDirtyNodes());this.onchange(b,a[1])}},i.prototype.cleanNodes=function(){this._updateCounter||b.each(this.nodes,function(a){a._dirty=!1})},i.prototype.getDirtyNodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},i.prototype.addNode=function(a,c){if(a=this._prepareNode(a),void 0!==a.maxWidth&&(a.width=Math.min(a.width,a.maxWidth)),void 0!==a.maxHeight&&(a.height=Math.min(a.height,a.maxHeight)),void 0!==a.minWidth&&(a.width=Math.max(a.width,a.minWidth)),void 0!==a.minHeight&&(a.height=Math.max(a.height,a.minHeight)),a._id=++h,a._dirty=!0,a.autoPosition){this._sortNodes();for(var d=0;;++d){var e=d%this.width,f=Math.floor(d/this.width);if(!(e+a.width>this.width)&&!b.find(this.nodes,b.bind(g._isAddNodeIntercepted,{x:e,y:f,node:a}))){a.x=e,a.y=f;break}}}return this.nodes.push(a),void 0!==c&&c&&this._addedNodes.push(b.clone(a)),this._fixCollisions(a),this._packNodes(),this._notify(),a},i.prototype.removeNode=function(a,c){c=void 0===c||c,this._removedNodes.push(b.clone(a)),a._id=null,this.nodes=b.without(this.nodes,a),this._packNodes(),this._notify(a,c)},i.prototype.canMoveNode=function(c,d,e,f,g){if(!this.isNodeChangedPosition(c,d,e,f,g))return!1;var h=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!h)return!0;var j,k=new i(this.width,null,this.float,0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));if(void 0===j)return!0;k.moveNode(j,d,e,f,g);var l=!0;return h&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.getGridHeight()<=this.height),l},i.prototype.canBePlacedWithRespectToHeight=function(c){if(!this.height)return!0;var d=new i(this.width,null,this.float,0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.addNode(c),d.getGridHeight()<=this.height},i.prototype.isNodeChangedPosition=function(a,b,c,d,e){return"number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),void 0!==a.maxWidth&&(d=Math.min(d,a.maxWidth)),void 0!==a.maxHeight&&(e=Math.min(e,a.maxHeight)),void 0!==a.minWidth&&(d=Math.max(d,a.minWidth)),void 0!==a.minHeight&&(e=Math.max(e,a.minHeight)),a.x!=b||a.y!=c||a.width!=d||a.height!=e},i.prototype.moveNode=function(a,b,c,d,e,f){if(!this.isNodeChangedPosition(a,b,c,d,e))return a;if("number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),void 0!==a.maxWidth&&(d=Math.min(d,a.maxWidth)),void 0!==a.maxHeight&&(e=Math.min(e,a.maxHeight)),void 0!==a.minWidth&&(d=Math.max(d,a.minWidth)),void 0!==a.minHeight&&(e=Math.max(e,a.minHeight)),a.x==b&&a.y==c&&a.width==d&&a.height==e)return a;var g=a.width!=d;return a._dirty=!0,a.x=b,a.y=c,a.width=d,a.height=e,a.lastTriedX=b,a.lastTriedY=c,a.lastTriedWidth=d,a.lastTriedHeight=e,a=this._prepareNode(a,g),this._fixCollisions(a),f||(this._packNodes(),this._notify()),a},i.prototype.getGridHeight=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},i.prototype.beginUpdate=function(a){b.each(this.nodes,function(a){a._origY=a.y}),a._updating=!0},i.prototype.endUpdate=function(){b.each(this.nodes,function(a){a._origY=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var j=function(d,e){var h,j,k=this;e=e||{},this.container=a(d),void 0!==e.handle_class&&(e.handleClass=e.handle_class,f("handle_class","handleClass")),void 0!==e.item_class&&(e.itemClass=e.item_class,f("item_class","itemClass")),void 0!==e.placeholder_class&&(e.placeholderClass=e.placeholder_class,f("placeholder_class","placeholderClass")),void 0!==e.placeholder_text&&(e.placeholderText=e.placeholder_text,f("placeholder_text","placeholderText")),void 0!==e.cell_height&&(e.cellHeight=e.cell_height,f("cell_height","cellHeight")),void 0!==e.vertical_margin&&(e.verticalMargin=e.vertical_margin,f("vertical_margin","verticalMargin")),void 0!==e.min_width&&(e.minWidth=e.min_width,f("min_width","minWidth")),void 0!==e.static_grid&&(e.staticGrid=e.static_grid,f("static_grid","staticGrid")),void 0!==e.is_nested&&(e.isNested=e.is_nested,f("is_nested","isNested")),void 0!==e.always_show_resize_handle&&(e.alwaysShowResizeHandle=e.always_show_resize_handle,f("always_show_resize_handle","alwaysShowResizeHandle")),e.itemClass=e.itemClass||"grid-stack-item";var l=this.container.closest("."+e.itemClass).length>0;if(this.opts=b.defaults(e||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,float:!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:b.defaults(e.resizable||{},{autoHide:!e.alwaysShowResizeHandle,handles:"se"}),draggable:b.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:e.disableDrag||!1,disableResize:e.disableResize||!1,rtl:"auto",removable:!1,removableOptions:b.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||!1,oneColumnModeClass:e.oneColumnModeClass||"grid-stack-one-column-mode",ddPlugin:null}),!1===this.opts.ddPlugin?this.opts.ddPlugin=c:null===this.opts.ddPlugin&&(this.opts.ddPlugin=b.first(c.registeredPlugins)||c),this.dd=new this.opts.ddPlugin(this),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&&this.container.addClass("grid-stack-rtl"),this.opts.isNested=l,j="auto"===this.opts.cellHeight,j?k.cellHeight(k.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),l&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new i(this.opts.width,function(a,c){c=void 0===c||c;var d=0;b.each(a,function(a){c&&null===a._id?a.el&&a.el.remove():(a.el.attr("data-gs-x",a.x).attr("data-gs-y",a.y).attr("data-gs-width",a.width).attr("data-gs-height",a.height),d=Math.max(d,a.y+a.height))}),k._updateStyles(d+10)},this.opts.float,this.opts.height),this.opts.auto){var m=[],n=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(b,c){c=a(c),m.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*n.opts.width})}),b.chain(m).sortBy(function(a){return a.i}).each(function(a){k._prepareElement(a.el)}).value()}if(this.setAnimation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholderText+"
").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=b.throttle(function(){k.cellHeight(k.cellWidth(),!1)},100),this.onResizeHandler=function(){if(j&&k._updateHeightsOnResize(),k._isOneColumnMode()&&!k.opts.disableOneColumnMode){if(h)return;k.container.addClass(k.opts.oneColumnModeClass),h=!0,k.grid._sortNodes(),b.each(k.grid.nodes,function(a){k.container.append(a.el),k.opts.staticGrid||(k.dd.draggable(a.el,"disable"),k.dd.resizable(a.el,"disable"),a.el.trigger("resize"))})}else{if(!h)return;if(k.container.removeClass(k.opts.oneColumnModeClass),h=!1,k.opts.staticGrid)return;b.each(k.grid.nodes,function(a){a.noMove||k.opts.disableDrag||k.dd.draggable(a.el,"enable"),a.noResize||k.opts.disableResize||k.dd.resizable(a.el,"enable"),a.el.trigger("resize")})}},a(window).resize(this.onResizeHandler),this.onResizeHandler(),!k.opts.staticGrid&&"string"==typeof k.opts.removable){var o=a(k.opts.removable);this.dd.isDroppable(o)||this.dd.droppable(o,k.opts.removableOptions),this.dd.on(o,"dropover",function(b,c){var d=a(c.draggable);d.data("_gridstack_node")._grid===k&&(d.data("inTrashZone",!0),k._setupRemovingTimeout(d))}).on(o,"dropout",function(b,c){var d=a(c.draggable);d.data("_gridstack_node")._grid===k&&(d.data("inTrashZone",!1),k._clearRemovingTimeout(d))})}if(!k.opts.staticGrid&&k.opts.acceptWidgets){var p=null,q=function(a,b){var c=p,d=c.data("_gridstack_node"),e=k.getCellFromPixel({left:a.pageX,top:a.pageY},!0),f=Math.max(0,e.x),g=Math.max(0,e.y);d._added||(d._added=!0,d.el=c,d.autoPosition=!0,d.x=f,d.y=g,k.grid.cleanNodes(),k.grid.beginUpdate(d),k.grid.addNode(d),k.container.append(k.placeholder),k.placeholder.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).show(),d.el=k.placeholder,d._beforeDragX=d.x,d._beforeDragY=d.y,k._updateContainerHeight()),k.grid.canMoveNode(d,f,g)&&(k.grid.moveNode(d,f,g),k._updateContainerHeight())};this.dd.droppable(k.container,{accept:function(b){b=a(b);var c=b.data("_gridstack_node");return(!c||c._grid!==k)&&b.is(!0===k.opts.acceptWidgets?".grid-stack-item":k.opts.acceptWidgets)}}).on(k.container,"dropover",function(b,c){var d=(k.container.offset(),a(c.draggable)),e=k.cellWidth(),f=k.cellHeight(),g=d.data("_gridstack_node"),h=g?g.width:Math.ceil(d.outerWidth()/e),i=g?g.height:Math.ceil(d.outerHeight()/f);p=d;var j=k.grid._prepareNode({width:h,height:i,_added:!1,_temporary:!0});d.data("_gridstack_node",j),d.data("_gridstack_node_orig",g),d.on("drag",q)}).on(k.container,"dropout",function(b,c){var d=a(c.draggable);if(d.data("_gridstack_node")){d.unbind("drag",q);var e=d.data("_gridstack_node");e.el=null,k.grid.removeNode(e),k.placeholder.detach(),k._updateContainerHeight(),d.data("_gridstack_node",d.data("_gridstack_node_orig"))}}).on(k.container,"drop",function(b,c){k.placeholder.detach();var d=a(c.draggable).data("_gridstack_node");d._grid=k;var e=a(c.draggable).clone(!1);e.data("_gridstack_node",d);var f=a(c.draggable).data("_gridstack_node_orig");void 0!==f&&void 0!==f._grid&&f._grid._triggerRemoveEvent(),a(c.helper).remove(),d.el=e,k.placeholder.hide(),g.removePositioningStyles(e),e.find("div.ui-resizable-handle").remove(),e.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).addClass(k.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",q),k.container.append(e),k._prepareElementsByNode(e,d),k._updateContainerHeight(),k.grid._addedNodes.push(d),k._triggerAddEvent(),k._triggerChangeEvent(),k.grid.endUpdate(),a(c.draggable).unbind("drag",q),a(c.draggable).removeData("_gridstack_node"),a(c.draggable).removeData("_gridstack_node_orig")})}};return j.prototype._triggerChangeEvent=function(a){var b=this.grid.getDirtyNodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||!0===a)&&this.container.trigger("change",d)},j.prototype._triggerAddEvent=function(){this.grid._addedNodes&&this.grid._addedNodes.length>0&&(this.container.trigger("added",[b.map(this.grid._addedNodes,b.clone)]),this.grid._addedNodes=[])},j.prototype._triggerRemoveEvent=function(){this.grid._removedNodes&&this.grid._removedNodes.length>0&&(this.container.trigger("removed",[b.map(this.grid._removedNodes,b.clone)]),this.grid._removedNodes=[])},j.prototype._initStyles=function(){this._stylesId&&g.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=g.createStylesheet(this._stylesId),null!==this._styles&&(this._styles._max=0)},j.prototype._updateStyles=function(a){if(null!==this._styles&&void 0!==this._styles){var b,c="."+this.opts._class+" ."+this.opts.itemClass,d=this;if(void 0===a&&(a=this._styles._max),!(0!==this._styles._max&&a<=this._styles._max)&&(this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&(b=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(a,b){return a&&b?"calc("+(d.opts.cellHeight*a+d.opts.cellHeightUnit)+" + "+(d.opts.verticalMargin*b+d.opts.verticalMarginUnit)+")":d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit}:function(a,b){return d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit},0===this._styles._max&&g.insertCSSRule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max))){for(var e=this._styles._max;e=f.grid.width||k<0||!f.grid.float&&k>f.grid.getGridHeight()?c._temporaryRemoved||(!0===f.opts.removable&&f._setupRemovingTimeout(b),j=c._beforeDragX,k=c._beforeDragY,f.placeholder.detach(),f.placeholder.hide(),f.grid.removeNode(c),f._updateContainerHeight(),c._temporaryRemoved=!0):(f._clearRemovingTimeout(b),c._temporaryRemoved&&(f.grid.addNode(c),f.placeholder.attr("data-gs-x",j).attr("data-gs-y",k).attr("data-gs-width",h).attr("data-gs-height",i).show(),f.container.append(f.placeholder),c.el=f.placeholder,c._temporaryRemoved=!1));else if("resize"==a.type&&j<0)return;var l=void 0!==h?h:c.lastTriedWidth,m=void 0!==i?i:c.lastTriedHeight;!f.grid.canMoveNode(c,j,k,h,i)||c.lastTriedX===j&&c.lastTriedY===k&&c.lastTriedWidth===l&&c.lastTriedHeight===m||(c.lastTriedX=j,c.lastTriedY=k,c.lastTriedWidth=h,c.lastTriedHeight=i,f.grid.moveNode(c,j,k,h,i),f._updateContainerHeight())},i=function(g,h){f.container.append(f.placeholder);var i=a(this);f.grid.cleanNodes(),f.grid.beginUpdate(c),d=f.cellWidth();var j=Math.ceil(i.outerHeight()/i.attr("data-gs-height"));e=f.container.height()/parseInt(f.container.attr("data-gs-current-height")),f.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),c.el=f.placeholder,c._beforeDragX=c.x,c._beforeDragY=c.y,f.dd.resizable(b,"option","minWidth",d*(c.minWidth||1)),f.dd.resizable(b,"option","minHeight",j*(c.minHeight||1)),"resizestart"==g.type&&i.find(".grid-stack-item").trigger("resizestart")},j=function(d,e){var h=a(this);if(h.data("_gridstack_node")){var i=!1;if(f.placeholder.detach(),c.el=h,f.placeholder.hide(),c._isAboutToRemove){i=!0;b.data("_gridstack_node")._grid._triggerRemoveEvent(),b.removeData("_gridstack_node"),b.remove()}else f._clearRemovingTimeout(b),c._temporaryRemoved?(g.removePositioningStyles(h),h.attr("data-gs-x",c._beforeDragX).attr("data-gs-y",c._beforeDragY).attr("data-gs-width",c.width).attr("data-gs-height",c.height),c.x=c._beforeDragX,c.y=c._beforeDragY,f.grid.addNode(c)):(g.removePositioningStyles(h),h.attr("data-gs-x",c.x).attr("data-gs-y",c.y).attr("data-gs-width",c.width).attr("data-gs-height",c.height));f._updateContainerHeight(),f._triggerChangeEvent(i),f.grid.endUpdate();var j=h.find(".grid-stack");j.length&&"resizestop"==d.type&&(j.each(function(b,c){a(c).data("gridstack").onResizeHandler()}),h.find(".grid-stack-item").trigger("resizestop"),h.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"==d.type&&f.container.trigger("gsresizestop",h)}};this.dd.draggable(b,{start:i,stop:j,drag:h}).resizable(b,{start:i,stop:j,resize:h}),(c.noMove||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(b,"disable"),(c.noResize||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(b,"disable"),b.attr("data-gs-locked",c.locked?"yes":null)},j.prototype._prepareElement=function(b,c){c=void 0!==c&&c;var d=this;b=a(b),b.addClass(this.opts.itemClass);var e=d.grid.addNode({x:b.attr("data-gs-x"),y:b.attr("data-gs-y"),width:b.attr("data-gs-width"),height:b.attr("data-gs-height"),maxWidth:b.attr("data-gs-max-width"),minWidth:b.attr("data-gs-min-width"),maxHeight:b.attr("data-gs-max-height"),minHeight:b.attr("data-gs-min-height"),autoPosition:g.toBool(b.attr("data-gs-auto-position")),noResize:g.toBool(b.attr("data-gs-no-resize")),noMove:g.toBool(b.attr("data-gs-no-move")),locked:g.toBool(b.attr("data-gs-locked")),resizeHandles:b.attr("data-gs-resize-handles"),el:b,id:b.attr("data-gs-id"),_grid:d},c);b.data("_gridstack_node",e),this._prepareElementsByNode(b,e)},j.prototype.setAnimation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},j.prototype.addWidget=function(b,c,d,e,f,g,h,i,j,k,l){return b=a(b),void 0!==c&&b.attr("data-gs-x",c),void 0!==d&&b.attr("data-gs-y",d),void 0!==e&&b.attr("data-gs-width",e),void 0!==f&&b.attr("data-gs-height",f),void 0!==g&&b.attr("data-gs-auto-position",g?"yes":null),void 0!==h&&b.attr("data-gs-min-width",h),void 0!==i&&b.attr("data-gs-max-width",i),void 0!==j&&b.attr("data-gs-min-height",j),void 0!==k&&b.attr("data-gs-max-height",k),void 0!==l&&b.attr("data-gs-id",l),this.container.append(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.makeWidget=function(b){return b=a(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.willItFit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,autoPosition:e};return this.grid.canBePlacedWithRespectToHeight(f)},j.prototype.removeWidget=function(b,c){c=void 0===c||c,b=a(b);var d=b.data("_gridstack_node");d||(d=this.grid.getNodeDataByDOMEl(b)),this.grid.removeNode(d,c),b.removeData("_gridstack_node"),this._updateContainerHeight(),c&&b.remove(),this._triggerChangeEvent(!0),this._triggerRemoveEvent()},j.prototype.removeAll=function(a){b.each(this.grid.nodes,b.bind(function(b){this.removeWidget(b.el,a)},this)),this.grid.nodes=[],this._updateContainerHeight()},j.prototype.destroy=function(b){a(window).off("resize",this.onResizeHandler),this.disable(),void 0===b||b?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),g.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},j.prototype.resizable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");void 0!==f&&null!==f&&(f.noResize=!c,f.noResize||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?d.dd.resizable(e,"disable"):d.dd.resizable(e,"enable"))}),this},j.prototype.movable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");void 0!==f&&null!==f&&(f.noMove=!c,f.noMove||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?(d.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(d.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},j.prototype.enableMove=function(a,b){this.movable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableDrag=!a)},j.prototype.enableResize=function(a,b){this.resizable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableResize=!a)},j.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},j.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},j.prototype.locked=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(e.locked=c||!1,d.attr("data-gs-locked",e.locked?"yes":null))}),this},j.prototype.maxHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.maxHeight=c||!1,d.attr("data-gs-max-height",c)))}),this},j.prototype.minHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.minHeight=c||!1,d.attr("data-gs-min-height",c)))}),this},j.prototype.maxWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.maxWidth=c||!1,d.attr("data-gs-max-width",c)))}),this},j.prototype.minWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.minWidth=c||!1,d.attr("data-gs-min-width",c)))}),this},j.prototype._updateElement=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if(void 0!==d&&null!==d){var e=this;e.grid.cleanNodes(),e.grid.beginUpdate(d),c.call(this,b,d),e._updateContainerHeight(),e._triggerChangeEvent(),e.grid.endUpdate()}},j.prototype.resize=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&void 0!==b?b:d.width,c=null!==c&&void 0!==c?c:d.height,this.grid.moveNode(d,d.x,d.y,b,c)})},j.prototype.move=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&void 0!==b?b:d.x,c=null!==c&&void 0!==c?c:d.y,this.grid.moveNode(d,b,c,d.width,d.height)})},j.prototype.update=function(a,b,c,d,e){this._updateElement(a,function(a,f){b=null!==b&&void 0!==b?b:f.x,c=null!==c&&void 0!==c?c:f.y,d=null!==d&&void 0!==d?d:f.width,e=null!==e&&void 0!==e?e:f.height,this.grid.moveNode(f,b,c,d,e)})},j.prototype.verticalMargin=function(a,b){if(void 0===a)return this.opts.verticalMargin;var c=g.parseHeight(a);this.opts.verticalMarginUnit===c.unit&&this.opts.height===c.height||(this.opts.verticalMarginUnit=c.unit,this.opts.verticalMargin=c.height,b||this._updateStyles())},j.prototype.cellHeight=function(a,b){if(void 0===a){if(this.opts.cellHeight)return this.opts.cellHeight;var c=this.container.children("."+this.opts.itemClass).first();return Math.ceil(c.outerHeight()/c.attr("data-gs-height"))}var d=g.parseHeight(a);this.opts.cellHeightUnit===d.heightUnit&&this.opts.height===d.height||(this.opts.cellHeightUnit=d.unit,this.opts.cellHeight=d.height,b||this._updateStyles())},j.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.width)},j.prototype.getCellFromPixel=function(a,b){var c=void 0!==b&&b?this.container.offset():this.container.position(),d=a.left-c.left,e=a.top-c.top,f=Math.floor(this.container.width()/this.opts.width),g=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(d/f),y:Math.floor(e/g)}},j.prototype.batchUpdate=function(){this.grid.batchUpdate()},j.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},j.prototype.isAreaEmpty=function(a,b,c,d){return this.grid.isAreaEmpty(a,b,c,d)},j.prototype.setStatic=function(a){this.opts.staticGrid=!0===a,this.enableMove(!a),this.enableResize(!a),this._setStaticClass()},j.prototype._setStaticClass=function(){!0===this.opts.staticGrid?this.container.addClass("grid-stack-static"):this.container.removeClass("grid-stack-static")},j.prototype._updateNodeWidths=function(a,b){this.grid._sortNodes(),this.grid.batchUpdate();for(var c={},d=0;d .ui-resizable-handle { - filter: none; -} - -.grid-stack { - position: relative; -} - -.grid-stack.grid-stack-rtl { - direction: ltr; -} - -.grid-stack.grid-stack-rtl > .grid-stack-item { - direction: rtl; -} - -.grid-stack .grid-stack-placeholder > .placeholder-content { - border: 1px dashed lightgray; - margin: 0; - position: absolute; - top: 0; - left: 10px; - right: 10px; - bottom: 0; - width: auto; - z-index: 0 !important; - text-align: center; -} - -.grid-stack > .grid-stack-item { - min-width: 8.3333333333%; - position: absolute; - padding: 0; -} - -.grid-stack > .grid-stack-item > .grid-stack-item-content { - margin: 0; - position: absolute; - top: 0; - left: 10px; - right: 10px; - bottom: 0; - width: auto; - z-index: 0 !important; - overflow-x: hidden; - overflow-y: auto; -} - -.grid-stack > .grid-stack-item > .ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - -ms-touch-action: none; - touch-action: none; -} - -.grid-stack > .grid-stack-item.ui-resizable-disabled > .ui-resizable-handle, -.grid-stack > .grid-stack-item.ui-resizable-autohide > .ui-resizable-handle { - display: none; -} - -.grid-stack > .grid-stack-item.ui-draggable-dragging, .grid-stack > .grid-stack-item.ui-resizable-resizing { - z-index: 100; -} - -.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content, -.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content, .grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content, -.grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content { - box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2); - opacity: 0.8; -} - -.grid-stack > .grid-stack-item > .ui-resizable-se, -.grid-stack > .grid-stack-item > .ui-resizable-sw { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K); - background-repeat: no-repeat; - background-position: center; - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} - -.grid-stack > .grid-stack-item > .ui-resizable-se { - -webkit-transform: rotate(-45deg); - -moz-transform: rotate(-45deg); - -ms-transform: rotate(-45deg); - -o-transform: rotate(-45deg); - transform: rotate(-45deg); -} - -.grid-stack > .grid-stack-item > .ui-resizable-nw { - cursor: nw-resize; - width: 20px; - height: 20px; - left: 10px; - top: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-n { - cursor: n-resize; - height: 10px; - top: 0; - left: 25px; - right: 25px; -} - -.grid-stack > .grid-stack-item > .ui-resizable-ne { - cursor: ne-resize; - width: 20px; - height: 20px; - right: 10px; - top: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-e { - cursor: e-resize; - width: 10px; - right: 10px; - top: 15px; - bottom: 15px; -} - -.grid-stack > .grid-stack-item > .ui-resizable-se { - cursor: se-resize; - width: 20px; - height: 20px; - right: 10px; - bottom: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-s { - cursor: s-resize; - height: 10px; - left: 25px; - bottom: 0; - right: 25px; -} - -.grid-stack > .grid-stack-item > .ui-resizable-sw { - cursor: sw-resize; - width: 20px; - height: 20px; - left: 10px; - bottom: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-w { - cursor: w-resize; - width: 10px; - left: 10px; - top: 15px; - bottom: 15px; -} - -.grid-stack > .grid-stack-item.ui-draggable-dragging > .ui-resizable-handle { - display: none !important; -} - -.grid-stack > .grid-stack-item[data-gs-width='1'] { - width: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='1'] { - left: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='1'] { - min-width: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='1'] { - max-width: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='2'] { - width: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='2'] { - left: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='2'] { - min-width: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='2'] { - max-width: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='3'] { - width: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-x='3'] { - left: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='3'] { - min-width: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='3'] { - max-width: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-width='4'] { - width: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='4'] { - left: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='4'] { - min-width: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='4'] { - max-width: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='5'] { - width: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='5'] { - left: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='5'] { - min-width: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='5'] { - max-width: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='6'] { - width: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-x='6'] { - left: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='6'] { - min-width: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='6'] { - max-width: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-width='7'] { - width: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='7'] { - left: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='7'] { - min-width: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='7'] { - max-width: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='8'] { - width: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='8'] { - left: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='8'] { - min-width: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='8'] { - max-width: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='9'] { - width: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-x='9'] { - left: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='9'] { - min-width: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='9'] { - max-width: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-width='10'] { - width: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='10'] { - left: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='10'] { - min-width: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='10'] { - max-width: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='11'] { - width: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='11'] { - left: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='11'] { - min-width: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='11'] { - max-width: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='12'] { - width: 100%; -} - -.grid-stack > .grid-stack-item[data-gs-x='12'] { - left: 100%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='12'] { - min-width: 100%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='12'] { - max-width: 100%; -} - -.grid-stack.grid-stack-animate, -.grid-stack.grid-stack-animate .grid-stack-item { - -webkit-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - -moz-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - -ms-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - -o-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; -} - -.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging, -.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing, -.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder { - -webkit-transition: left 0s, top 0s, height 0s, width 0s; - -moz-transition: left 0s, top 0s, height 0s, width 0s; - -ms-transition: left 0s, top 0s, height 0s, width 0s; - -o-transition: left 0s, top 0s, height 0s, width 0s; - transition: left 0s, top 0s, height 0s, width 0s; -} - -.grid-stack.grid-stack-one-column-mode { - height: auto !important; -} - -.grid-stack.grid-stack-one-column-mode > .grid-stack-item { - position: relative !important; - width: auto !important; - left: 0 !important; - top: auto !important; - margin-bottom: 20px; - max-width: none !important; -} - -.grid-stack.grid-stack-one-column-mode > .grid-stack-item > .ui-resizable-handle { - display: none; -} diff --git a/dist/gridstack.jQueryUI.js b/dist/gridstack.jQueryUI.js deleted file mode 100644 index 1cae78d09..000000000 --- a/dist/gridstack.jQueryUI.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -(function(factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery', 'lodash', 'gridstack', 'jquery-ui/data', 'jquery-ui/disable-selection', 'jquery-ui/focusable', - 'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels', 'jquery-ui/jquery-1-7', - 'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur', 'jquery-ui/scroll-parent', - 'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version', 'jquery-ui/widget', - 'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable', 'jquery-ui/widgets/droppable', - 'jquery-ui/widgets/resizable'], factory); - } else if (typeof exports !== 'undefined') { - try { jQuery = require('jquery'); } catch (e) {} - try { _ = require('lodash'); } catch (e) {} - try { GridStackUI = require('gridstack'); } catch (e) {} - factory(jQuery, _, GridStackUI); - } else { - factory(jQuery, _, GridStackUI); - } -})(function($, _, GridStackUI) { - - var scope = window; - - /** - * @class JQueryUIGridStackDragDropPlugin - * jQuery UI implementation of drag'n'drop gridstack plugin. - */ - function JQueryUIGridStackDragDropPlugin(grid) { - GridStackUI.GridStackDragDropPlugin.call(this, grid); - } - - GridStackUI.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin); - - JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStackUI.GridStackDragDropPlugin.prototype); - JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin; - - JQueryUIGridStackDragDropPlugin.prototype.resizable = function(el, opts) { - el = $(el); - if (opts === 'disable' || opts === 'enable') { - el.resizable(opts); - } else if (opts === 'option') { - var key = arguments[2]; - var value = arguments[3]; - el.resizable(opts, key, value); - } else { - var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') : - this.grid.opts.resizable.handles; - el.resizable(_.extend({}, this.grid.opts.resizable, { - handles: handles - }, { - start: opts.start || function() {}, - stop: opts.stop || function() {}, - resize: opts.resize || function() {} - })); - } - return this; - }; - - JQueryUIGridStackDragDropPlugin.prototype.draggable = function(el, opts) { - el = $(el); - if (opts === 'disable' || opts === 'enable') { - el.draggable(opts); - } else { - el.draggable(_.extend({}, this.grid.opts.draggable, { - containment: this.grid.opts.isNested ? this.grid.container.parent() : null, - start: opts.start || function() {}, - stop: opts.stop || function() {}, - drag: opts.drag || function() {} - })); - } - return this; - }; - - JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) { - el = $(el); - el.droppable(opts); - return this; - }; - - JQueryUIGridStackDragDropPlugin.prototype.isDroppable = function(el, opts) { - el = $(el); - return Boolean(el.data('droppable')); - }; - - JQueryUIGridStackDragDropPlugin.prototype.on = function(el, eventName, callback) { - $(el).on(eventName, callback); - return this; - }; - - return JQueryUIGridStackDragDropPlugin; -}); diff --git a/dist/gridstack.jQueryUI.min.js b/dist/gridstack.jQueryUI.min.js deleted file mode 100644 index 2f633b80a..000000000 --- a/dist/gridstack.jQueryUI.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","gridstack","jquery-ui/data","jquery-ui/disable-selection","jquery-ui/focusable","jquery-ui/form","jquery-ui/ie","jquery-ui/keycode","jquery-ui/labels","jquery-ui/jquery-1-7","jquery-ui/plugin","jquery-ui/safe-active-element","jquery-ui/safe-blur","jquery-ui/scroll-parent","jquery-ui/tabbable","jquery-ui/unique-id","jquery-ui/version","jquery-ui/widget","jquery-ui/widgets/mouse","jquery-ui/widgets/draggable","jquery-ui/widgets/droppable","jquery-ui/widgets/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(a){}try{_=require("lodash")}catch(a){}try{GridStackUI=require("gridstack")}catch(a){}a(jQuery,_,GridStackUI)}else a(jQuery,_,GridStackUI)}(function(a,b,c){function d(a){c.GridStackDragDropPlugin.call(this,a)}window;return c.GridStackDragDropPlugin.registerPlugin(d),d.prototype=Object.create(c.GridStackDragDropPlugin.prototype),d.prototype.constructor=d,d.prototype.resizable=function(c,d){if(c=a(c),"disable"===d||"enable"===d)c.resizable(d);else if("option"===d){var e=arguments[2],f=arguments[3];c.resizable(d,e,f)}else{var g=c.data("gs-resize-handles")?c.data("gs-resize-handles"):this.grid.opts.resizable.handles;c.resizable(b.extend({},this.grid.opts.resizable,{handles:g},{start:d.start||function(){},stop:d.stop||function(){},resize:d.resize||function(){}}))}return this},d.prototype.draggable=function(c,d){return c=a(c),"disable"===d||"enable"===d?c.draggable(d):c.draggable(b.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested?this.grid.container.parent():null,start:d.start||function(){},stop:d.stop||function(){},drag:d.drag||function(){}})),this},d.prototype.droppable=function(b,c){return b=a(b),b.droppable(c),this},d.prototype.isDroppable=function(b,c){return b=a(b),Boolean(b.data("droppable"))},d.prototype.on=function(b,c,d){return a(b).on(c,d),this},d}); -//# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.js b/dist/gridstack.js deleted file mode 100644 index 71e2f9d45..000000000 --- a/dist/gridstack.js +++ /dev/null @@ -1,1785 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -(function(factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery', 'lodash'], factory); - } else if (typeof exports !== 'undefined') { - try { jQuery = require('jquery'); } catch (e) {} - try { _ = require('lodash'); } catch (e) {} - factory(jQuery, _); - } else { - factory(jQuery, _); - } -})(function($, _) { - - var scope = window; - - var obsolete = function(f, oldName, newName) { - var wrapper = function() { - console.warn('gridstack.js: Function `' + oldName + '` is deprecated as of v0.2.5 and has been replaced ' + - 'with `' + newName + '`. It will be **completely** removed in v1.0.'); - return f.apply(this, arguments); - }; - wrapper.prototype = f.prototype; - - return wrapper; - }; - - var obsoleteOpts = function(oldName, newName) { - console.warn('gridstack.js: Option `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + - newName + '`. It will be **completely** removed in v1.0.'); - }; - - var Utils = { - isIntercepted: function(a, b) { - return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y); - }, - - sort: function(nodes, dir, width) { - width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value(); - dir = dir != -1 ? 1 : -1; - return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); }); - }, - - createStylesheet: function(id) { - var style = document.createElement('style'); - style.setAttribute('type', 'text/css'); - style.setAttribute('data-gs-style-id', id); - if (style.styleSheet) { - style.styleSheet.cssText = ''; - } else { - style.appendChild(document.createTextNode('')); - } - document.getElementsByTagName('head')[0].appendChild(style); - return style.sheet; - }, - - removeStylesheet: function(id) { - $('STYLE[data-gs-style-id=' + id + ']').remove(); - }, - - insertCSSRule: function(sheet, selector, rules, index) { - if (typeof sheet.insertRule === 'function') { - sheet.insertRule(selector + '{' + rules + '}', index); - } else if (typeof sheet.addRule === 'function') { - sheet.addRule(selector, rules, index); - } - }, - - toBool: function(v) { - if (typeof v == 'boolean') { - return v; - } - if (typeof v == 'string') { - v = v.toLowerCase(); - return !(v === '' || v == 'no' || v == 'false' || v == '0'); - } - return Boolean(v); - }, - - _collisionNodeCheck: function(n) { - return n != this.node && Utils.isIntercepted(n, this.nn); - }, - - _didCollide: function(bn) { - return Utils.isIntercepted({x: this.n.x, y: this.newY, width: this.n.width, height: this.n.height}, bn); - }, - - _isAddNodeIntercepted: function(n) { - return Utils.isIntercepted({x: this.x, y: this.y, width: this.node.width, height: this.node.height}, n); - }, - - parseHeight: function(val) { - var height = val; - var heightUnit = 'px'; - if (height && _.isString(height)) { - var match = height.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/); - if (!match) { - throw new Error('Invalid height'); - } - heightUnit = match[2] || 'px'; - height = parseFloat(match[1]); - } - return {height: height, unit: heightUnit}; - }, - - removePositioningStyles: function(el) { - var style = el[0].style; - if (style.position) { - style.removeProperty('position'); - } - if (style.left) { - style.removeProperty('left'); - } - if (style.top) { - style.removeProperty('top'); - } - if (style.width) { - style.removeProperty('width'); - } - if (style.height) { - style.removeProperty('height'); - } - } - }; - - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - Utils.is_intercepted = obsolete(Utils.isIntercepted, 'is_intercepted', 'isIntercepted'); - - Utils.create_stylesheet = obsolete(Utils.createStylesheet, 'create_stylesheet', 'createStylesheet'); - - Utils.remove_stylesheet = obsolete(Utils.removeStylesheet, 'remove_stylesheet', 'removeStylesheet'); - - Utils.insert_css_rule = obsolete(Utils.insertCSSRule, 'insert_css_rule', 'insertCSSRule'); - // jscs:enable requireCamelCaseOrUpperCaseIdentifiers - - /** - * @class GridStackDragDropPlugin - * Base class for drag'n'drop plugin. - */ - function GridStackDragDropPlugin(grid) { - this.grid = grid; - } - - GridStackDragDropPlugin.registeredPlugins = []; - - GridStackDragDropPlugin.registerPlugin = function(pluginClass) { - GridStackDragDropPlugin.registeredPlugins.push(pluginClass); - }; - - GridStackDragDropPlugin.prototype.resizable = function(el, opts) { - return this; - }; - - GridStackDragDropPlugin.prototype.draggable = function(el, opts) { - return this; - }; - - GridStackDragDropPlugin.prototype.droppable = function(el, opts) { - return this; - }; - - GridStackDragDropPlugin.prototype.isDroppable = function(el) { - return false; - }; - - GridStackDragDropPlugin.prototype.on = function(el, eventName, callback) { - return this; - }; - - - var idSeq = 0; - - var GridStackEngine = function(width, onchange, floatMode, height, items) { - this.width = width; - this.float = floatMode || false; - this.height = height || 0; - - this.nodes = items || []; - this.onchange = onchange || function() {}; - - this._updateCounter = 0; - this._float = this.float; - - this._addedNodes = []; - this._removedNodes = []; - }; - - GridStackEngine.prototype.batchUpdate = function() { - this._updateCounter = 1; - this.float = true; - }; - - GridStackEngine.prototype.commit = function() { - if (this._updateCounter !== 0) { - this._updateCounter = 0; - this.float = this._float; - this._packNodes(); - this._notify(); - } - }; - - // For Meteor support: https://github.com/troolee/gridstack.js/pull/272 - GridStackEngine.prototype.getNodeDataByDOMEl = function(el) { - return _.find(this.nodes, function(n) { return el.get(0) === n.el.get(0); }); - }; - - GridStackEngine.prototype._fixCollisions = function(node) { - var self = this; - this._sortNodes(-1); - - var nn = node; - var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); - if (!this.float && !hasLocked) { - nn = {x: 0, y: node.y, width: this.width, height: node.height}; - } - while (true) { - var collisionNode = _.find(this.nodes, _.bind(Utils._collisionNodeCheck, {node: node, nn: nn})); - if (typeof collisionNode == 'undefined') { - return; - } - this.moveNode(collisionNode, collisionNode.x, node.y + node.height, - collisionNode.width, collisionNode.height, true); - } - }; - - GridStackEngine.prototype.isAreaEmpty = function(x, y, width, height) { - var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; - var collisionNode = _.find(this.nodes, _.bind(function(n) { - return Utils.isIntercepted(n, nn); - }, this)); - return collisionNode === null || typeof collisionNode === 'undefined'; - }; - - GridStackEngine.prototype._sortNodes = function(dir) { - this.nodes = Utils.sort(this.nodes, dir, this.width); - }; - - GridStackEngine.prototype._packNodes = function() { - this._sortNodes(); - - if (this.float) { - _.each(this.nodes, _.bind(function(n, i) { - if (n._updating || typeof n._origY == 'undefined' || n.y == n._origY) { - return; - } - - var newY = n.y; - while (newY >= n._origY) { - var collisionNode = _.chain(this.nodes) - .take(i) - .find(_.bind(Utils._didCollide, {n: n, newY: newY})) - .value(); - - if (!collisionNode) { - n._dirty = true; - n.y = newY; - } - --newY; - } - }, this)); - } else { - _.each(this.nodes, _.bind(function(n, i) { - if (n.locked) { - return; - } - while (n.y > 0) { - var newY = n.y - 1; - var canBeMoved = i === 0; - - if (i > 0) { - var collisionNode = _.chain(this.nodes) - .take(i) - .find(_.bind(Utils._didCollide, {n: n, newY: newY})) - .value(); - canBeMoved = typeof collisionNode == 'undefined'; - } - - if (!canBeMoved) { - break; - } - n._dirty = n.y != newY; - n.y = newY; - } - }, this)); - } - }; - - GridStackEngine.prototype._prepareNode = function(node, resizing) { - node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0}); - - node.x = parseInt('' + node.x); - node.y = parseInt('' + node.y); - node.width = parseInt('' + node.width); - node.height = parseInt('' + node.height); - node.autoPosition = node.autoPosition || false; - node.noResize = node.noResize || false; - node.noMove = node.noMove || false; - - if (node.width > this.width) { - node.width = this.width; - } else if (node.width < 1) { - node.width = 1; - } - - if (node.height < 1) { - node.height = 1; - } - - if (node.x < 0) { - node.x = 0; - } - - if (node.x + node.width > this.width) { - if (resizing) { - node.width = this.width - node.x; - } else { - node.x = this.width - node.width; - } - } - - if (node.y < 0) { - node.y = 0; - } - - return node; - }; - - GridStackEngine.prototype._notify = function() { - var args = Array.prototype.slice.call(arguments, 0); - args[0] = typeof args[0] === 'undefined' ? [] : [args[0]]; - args[1] = typeof args[1] === 'undefined' ? true : args[1]; - if (this._updateCounter) { - return; - } - var deletedNodes = args[0].concat(this.getDirtyNodes()); - this.onchange(deletedNodes, args[1]); - }; - - GridStackEngine.prototype.cleanNodes = function() { - if (this._updateCounter) { - return; - } - _.each(this.nodes, function(n) {n._dirty = false; }); - }; - - GridStackEngine.prototype.getDirtyNodes = function() { - return _.filter(this.nodes, function(n) { return n._dirty; }); - }; - - GridStackEngine.prototype.addNode = function(node, triggerAddEvent) { - node = this._prepareNode(node); - - if (typeof node.maxWidth != 'undefined') { node.width = Math.min(node.width, node.maxWidth); } - if (typeof node.maxHeight != 'undefined') { node.height = Math.min(node.height, node.maxHeight); } - if (typeof node.minWidth != 'undefined') { node.width = Math.max(node.width, node.minWidth); } - if (typeof node.minHeight != 'undefined') { node.height = Math.max(node.height, node.minHeight); } - - node._id = ++idSeq; - node._dirty = true; - - if (node.autoPosition) { - this._sortNodes(); - - for (var i = 0;; ++i) { - var x = i % this.width; - var y = Math.floor(i / this.width); - if (x + node.width > this.width) { - continue; - } - if (!_.find(this.nodes, _.bind(Utils._isAddNodeIntercepted, {x: x, y: y, node: node}))) { - node.x = x; - node.y = y; - break; - } - } - } - - this.nodes.push(node); - if (typeof triggerAddEvent != 'undefined' && triggerAddEvent) { - this._addedNodes.push(_.clone(node)); - } - - this._fixCollisions(node); - this._packNodes(); - this._notify(); - return node; - }; - - GridStackEngine.prototype.removeNode = function(node, detachNode) { - detachNode = typeof detachNode === 'undefined' ? true : detachNode; - this._removedNodes.push(_.clone(node)); - node._id = null; - this.nodes = _.without(this.nodes, node); - this._packNodes(); - this._notify(node, detachNode); - }; - - GridStackEngine.prototype.canMoveNode = function(node, x, y, width, height) { - if (!this.isNodeChangedPosition(node, x, y, width, height)) { - return false; - } - var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); - - if (!this.height && !hasLocked) { - return true; - } - - var clonedNode; - var clone = new GridStackEngine( - this.width, - null, - this.float, - 0, - _.map(this.nodes, function(n) { - if (n == node) { - clonedNode = $.extend({}, n); - return clonedNode; - } - return $.extend({}, n); - })); - - if (typeof clonedNode === 'undefined') { - return true; - } - - clone.moveNode(clonedNode, x, y, width, height); - - var res = true; - - if (hasLocked) { - res &= !Boolean(_.find(clone.nodes, function(n) { - return n != clonedNode && Boolean(n.locked) && Boolean(n._dirty); - })); - } - if (this.height) { - res &= clone.getGridHeight() <= this.height; - } - - return res; - }; - - GridStackEngine.prototype.canBePlacedWithRespectToHeight = function(node) { - if (!this.height) { - return true; - } - - var clone = new GridStackEngine( - this.width, - null, - this.float, - 0, - _.map(this.nodes, function(n) { return $.extend({}, n); })); - clone.addNode(node); - return clone.getGridHeight() <= this.height; - }; - - GridStackEngine.prototype.isNodeChangedPosition = function(node, x, y, width, height) { - if (typeof x != 'number') { x = node.x; } - if (typeof y != 'number') { y = node.y; } - if (typeof width != 'number') { width = node.width; } - if (typeof height != 'number') { height = node.height; } - - if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); } - if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); } - if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); } - if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); } - - if (node.x == x && node.y == y && node.width == width && node.height == height) { - return false; - } - return true; - }; - - GridStackEngine.prototype.moveNode = function(node, x, y, width, height, noPack) { - if (!this.isNodeChangedPosition(node, x, y, width, height)) { - return node; - } - if (typeof x != 'number') { x = node.x; } - if (typeof y != 'number') { y = node.y; } - if (typeof width != 'number') { width = node.width; } - if (typeof height != 'number') { height = node.height; } - - if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); } - if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); } - if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); } - if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); } - - if (node.x == x && node.y == y && node.width == width && node.height == height) { - return node; - } - - var resizing = node.width != width; - node._dirty = true; - - node.x = x; - node.y = y; - node.width = width; - node.height = height; - - node.lastTriedX = x; - node.lastTriedY = y; - node.lastTriedWidth = width; - node.lastTriedHeight = height; - - node = this._prepareNode(node, resizing); - - this._fixCollisions(node); - if (!noPack) { - this._packNodes(); - this._notify(); - } - return node; - }; - - GridStackEngine.prototype.getGridHeight = function() { - return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0); - }; - - GridStackEngine.prototype.beginUpdate = function(node) { - _.each(this.nodes, function(n) { - n._origY = n.y; - }); - node._updating = true; - }; - - GridStackEngine.prototype.endUpdate = function() { - _.each(this.nodes, function(n) { - n._origY = n.y; - }); - var n = _.find(this.nodes, function(n) { return n._updating; }); - if (n) { - n._updating = false; - } - }; - - var GridStack = function(el, opts) { - var self = this; - var oneColumnMode, isAutoCellHeight; - - opts = opts || {}; - - this.container = $(el); - - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - if (typeof opts.handle_class !== 'undefined') { - opts.handleClass = opts.handle_class; - obsoleteOpts('handle_class', 'handleClass'); - } - if (typeof opts.item_class !== 'undefined') { - opts.itemClass = opts.item_class; - obsoleteOpts('item_class', 'itemClass'); - } - if (typeof opts.placeholder_class !== 'undefined') { - opts.placeholderClass = opts.placeholder_class; - obsoleteOpts('placeholder_class', 'placeholderClass'); - } - if (typeof opts.placeholder_text !== 'undefined') { - opts.placeholderText = opts.placeholder_text; - obsoleteOpts('placeholder_text', 'placeholderText'); - } - if (typeof opts.cell_height !== 'undefined') { - opts.cellHeight = opts.cell_height; - obsoleteOpts('cell_height', 'cellHeight'); - } - if (typeof opts.vertical_margin !== 'undefined') { - opts.verticalMargin = opts.vertical_margin; - obsoleteOpts('vertical_margin', 'verticalMargin'); - } - if (typeof opts.min_width !== 'undefined') { - opts.minWidth = opts.min_width; - obsoleteOpts('min_width', 'minWidth'); - } - if (typeof opts.static_grid !== 'undefined') { - opts.staticGrid = opts.static_grid; - obsoleteOpts('static_grid', 'staticGrid'); - } - if (typeof opts.is_nested !== 'undefined') { - opts.isNested = opts.is_nested; - obsoleteOpts('is_nested', 'isNested'); - } - if (typeof opts.always_show_resize_handle !== 'undefined') { - opts.alwaysShowResizeHandle = opts.always_show_resize_handle; - obsoleteOpts('always_show_resize_handle', 'alwaysShowResizeHandle'); - } - // jscs:enable requireCamelCaseOrUpperCaseIdentifiers - - opts.itemClass = opts.itemClass || 'grid-stack-item'; - var isNested = this.container.closest('.' + opts.itemClass).length > 0; - - this.opts = _.defaults(opts || {}, { - width: parseInt(this.container.attr('data-gs-width')) || 12, - height: parseInt(this.container.attr('data-gs-height')) || 0, - itemClass: 'grid-stack-item', - placeholderClass: 'grid-stack-placeholder', - placeholderText: '', - handle: '.grid-stack-item-content', - handleClass: null, - cellHeight: 60, - verticalMargin: 20, - auto: true, - minWidth: 768, - float: false, - staticGrid: false, - _class: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), - animate: Boolean(this.container.attr('data-gs-animate')) || false, - alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, - resizable: _.defaults(opts.resizable || {}, { - autoHide: !(opts.alwaysShowResizeHandle || false), - handles: 'se' - }), - draggable: _.defaults(opts.draggable || {}, { - handle: (opts.handleClass ? '.' + opts.handleClass : (opts.handle ? opts.handle : '')) || - '.grid-stack-item-content', - scroll: false, - appendTo: 'body' - }), - disableDrag: opts.disableDrag || false, - disableResize: opts.disableResize || false, - rtl: 'auto', - removable: false, - removableOptions: _.defaults(opts.removableOptions || {}, { - accept: '.' + opts.itemClass - }), - removeTimeout: 2000, - verticalMarginUnit: 'px', - cellHeightUnit: 'px', - disableOneColumnMode: opts.disableOneColumnMode || false, - oneColumnModeClass: opts.oneColumnModeClass || 'grid-stack-one-column-mode', - ddPlugin: null - }); - - if (this.opts.ddPlugin === false) { - this.opts.ddPlugin = GridStackDragDropPlugin; - } else if (this.opts.ddPlugin === null) { - this.opts.ddPlugin = _.first(GridStackDragDropPlugin.registeredPlugins) || GridStackDragDropPlugin; - } - - this.dd = new this.opts.ddPlugin(this); - - if (this.opts.rtl === 'auto') { - this.opts.rtl = this.container.css('direction') === 'rtl'; - } - - if (this.opts.rtl) { - this.container.addClass('grid-stack-rtl'); - } - - this.opts.isNested = isNested; - - isAutoCellHeight = this.opts.cellHeight === 'auto'; - if (isAutoCellHeight) { - self.cellHeight(self.cellWidth(), true); - } else { - this.cellHeight(this.opts.cellHeight, true); - } - this.verticalMargin(this.opts.verticalMargin, true); - - this.container.addClass(this.opts._class); - - this._setStaticClass(); - - if (isNested) { - this.container.addClass('grid-stack-nested'); - } - - this._initStyles(); - - this.grid = new GridStackEngine(this.opts.width, function(nodes, detachNode) { - detachNode = typeof detachNode === 'undefined' ? true : detachNode; - var maxHeight = 0; - _.each(nodes, function(n) { - if (detachNode && n._id === null) { - if (n.el) { - n.el.remove(); - } - } else { - n.el - .attr('data-gs-x', n.x) - .attr('data-gs-y', n.y) - .attr('data-gs-width', n.width) - .attr('data-gs-height', n.height); - maxHeight = Math.max(maxHeight, n.y + n.height); - } - }); - self._updateStyles(maxHeight + 10); - }, this.opts.float, this.opts.height); - - if (this.opts.auto) { - var elements = []; - var _this = this; - this.container.children('.' + this.opts.itemClass + ':not(.' + this.opts.placeholderClass + ')') - .each(function(index, el) { - el = $(el); - elements.push({ - el: el, - i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width - }); - }); - _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) { - self._prepareElement(i.el); - }).value(); - } - - this.setAnimation(this.opts.animate); - - this.placeholder = $( - '
' + - '
' + this.opts.placeholderText + '
').hide(); - - this._updateContainerHeight(); - - this._updateHeightsOnResize = _.throttle(function() { - self.cellHeight(self.cellWidth(), false); - }, 100); - - this.onResizeHandler = function() { - if (isAutoCellHeight) { - self._updateHeightsOnResize(); - } - - if (self._isOneColumnMode() && !self.opts.disableOneColumnMode) { - if (oneColumnMode) { - return; - } - self.container.addClass(self.opts.oneColumnModeClass); - oneColumnMode = true; - - self.grid._sortNodes(); - _.each(self.grid.nodes, function(node) { - self.container.append(node.el); - - if (self.opts.staticGrid) { - return; - } - self.dd.draggable(node.el, 'disable'); - self.dd.resizable(node.el, 'disable'); - - node.el.trigger('resize'); - }); - } else { - if (!oneColumnMode) { - return; - } - - self.container.removeClass(self.opts.oneColumnModeClass); - oneColumnMode = false; - - if (self.opts.staticGrid) { - return; - } - - _.each(self.grid.nodes, function(node) { - if (!node.noMove && !self.opts.disableDrag) { - self.dd.draggable(node.el, 'enable'); - } - if (!node.noResize && !self.opts.disableResize) { - self.dd.resizable(node.el, 'enable'); - } - - node.el.trigger('resize'); - }); - } - }; - - $(window).resize(this.onResizeHandler); - this.onResizeHandler(); - - if (!self.opts.staticGrid && typeof self.opts.removable === 'string') { - var trashZone = $(self.opts.removable); - if (!this.dd.isDroppable(trashZone)) { - this.dd.droppable(trashZone, self.opts.removableOptions); - } - this.dd - .on(trashZone, 'dropover', function(event, ui) { - var el = $(ui.draggable); - var node = el.data('_gridstack_node'); - if (node._grid !== self) { - return; - } - el.data('inTrashZone', true); - self._setupRemovingTimeout(el); - }) - .on(trashZone, 'dropout', function(event, ui) { - var el = $(ui.draggable); - var node = el.data('_gridstack_node'); - if (node._grid !== self) { - return; - } - el.data('inTrashZone', false); - self._clearRemovingTimeout(el); - }); - } - - if (!self.opts.staticGrid && self.opts.acceptWidgets) { - var draggingElement = null; - - var onDrag = function(event, ui) { - var el = draggingElement; - var node = el.data('_gridstack_node'); - var pos = self.getCellFromPixel({left: event.pageX, top: event.pageY}, true); - var x = Math.max(0, pos.x); - var y = Math.max(0, pos.y); - if (!node._added) { - node._added = true; - - node.el = el; - node.autoPosition = true; - node.x = x; - node.y = y; - self.grid.cleanNodes(); - self.grid.beginUpdate(node); - self.grid.addNode(node); - - self.container.append(self.placeholder); - self.placeholder - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height) - .show(); - node.el = self.placeholder; - node._beforeDragX = node.x; - node._beforeDragY = node.y; - - self._updateContainerHeight(); - } - if (!self.grid.canMoveNode(node, x, y)) { - return; - } - self.grid.moveNode(node, x, y); - self._updateContainerHeight(); - }; - - this.dd - .droppable(self.container, { - accept: function(el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (node && node._grid === self) { - return false; - } - return el.is(self.opts.acceptWidgets === true ? '.grid-stack-item' : self.opts.acceptWidgets); - } - }) - .on(self.container, 'dropover', function(event, ui) { - var offset = self.container.offset(); - var el = $(ui.draggable); - var cellWidth = self.cellWidth(); - var cellHeight = self.cellHeight(); - var origNode = el.data('_gridstack_node'); - - var width = origNode ? origNode.width : (Math.ceil(el.outerWidth() / cellWidth)); - var height = origNode ? origNode.height : (Math.ceil(el.outerHeight() / cellHeight)); - - draggingElement = el; - - var node = self.grid._prepareNode({width: width, height: height, _added: false, _temporary: true}); - el.data('_gridstack_node', node); - el.data('_gridstack_node_orig', origNode); - - el.on('drag', onDrag); - }) - .on(self.container, 'dropout', function(event, ui) { - var el = $(ui.draggable); - if (!el.data('_gridstack_node')) { - return; - } - el.unbind('drag', onDrag); - var node = el.data('_gridstack_node'); - node.el = null; - self.grid.removeNode(node); - self.placeholder.detach(); - self._updateContainerHeight(); - el.data('_gridstack_node', el.data('_gridstack_node_orig')); - }) - .on(self.container, 'drop', function(event, ui) { - self.placeholder.detach(); - - var node = $(ui.draggable).data('_gridstack_node'); - node._grid = self; - var el = $(ui.draggable).clone(false); - el.data('_gridstack_node', node); - var originalNode = $(ui.draggable).data('_gridstack_node_orig'); - if (typeof originalNode !== 'undefined' && typeof originalNode._grid !== 'undefined') { - originalNode._grid._triggerRemoveEvent(); - } - $(ui.helper).remove(); - node.el = el; - self.placeholder.hide(); - Utils.removePositioningStyles(el); - el.find('div.ui-resizable-handle').remove(); - - el - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height) - .addClass(self.opts.itemClass) - .enableSelection() - .removeData('draggable') - .removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled') - .unbind('drag', onDrag); - self.container.append(el); - self._prepareElementsByNode(el, node); - self._updateContainerHeight(); - self.grid._addedNodes.push(node); - self._triggerAddEvent(); - self._triggerChangeEvent(); - - self.grid.endUpdate(); - $(ui.draggable).unbind('drag', onDrag); - $(ui.draggable).removeData('_gridstack_node'); - $(ui.draggable).removeData('_gridstack_node_orig'); - }); - } - }; - - GridStack.prototype._triggerChangeEvent = function(forceTrigger) { - var elements = this.grid.getDirtyNodes(); - var hasChanges = false; - - var eventParams = []; - if (elements && elements.length) { - eventParams.push(elements); - hasChanges = true; - } - - if (hasChanges || forceTrigger === true) { - this.container.trigger('change', eventParams); - } - }; - - GridStack.prototype._triggerAddEvent = function() { - if (this.grid._addedNodes && this.grid._addedNodes.length > 0) { - this.container.trigger('added', [_.map(this.grid._addedNodes, _.clone)]); - this.grid._addedNodes = []; - } - }; - - GridStack.prototype._triggerRemoveEvent = function() { - if (this.grid._removedNodes && this.grid._removedNodes.length > 0) { - this.container.trigger('removed', [_.map(this.grid._removedNodes, _.clone)]); - this.grid._removedNodes = []; - } - }; - - GridStack.prototype._initStyles = function() { - if (this._stylesId) { - Utils.removeStylesheet(this._stylesId); - } - this._stylesId = 'gridstack-style-' + (Math.random() * 100000).toFixed(); - this._styles = Utils.createStylesheet(this._stylesId); - if (this._styles !== null) { - this._styles._max = 0; - } - }; - - GridStack.prototype._updateStyles = function(maxHeight) { - if (this._styles === null || typeof this._styles === 'undefined') { - return; - } - - var prefix = '.' + this.opts._class + ' .' + this.opts.itemClass; - var self = this; - var getHeight; - - if (typeof maxHeight == 'undefined') { - maxHeight = this._styles._max; - } - if (this._styles._max !== 0 && maxHeight <= this._styles._max) { // Keep this._styles._max increasing - return ; - } - this._initStyles(); - this._updateContainerHeight(); - if (!this.opts.cellHeight) { // The rest will be handled by CSS - return ; - } - - if (!this.opts.verticalMargin || this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { - getHeight = function(nbRows, nbMargins) { - return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + - self.opts.cellHeightUnit; - }; - } else { - getHeight = function(nbRows, nbMargins) { - if (!nbRows || !nbMargins) { - return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + - self.opts.cellHeightUnit; - } - return 'calc(' + ((self.opts.cellHeight * nbRows) + self.opts.cellHeightUnit) + ' + ' + - ((self.opts.verticalMargin * nbMargins) + self.opts.verticalMarginUnit) + ')'; - }; - } - - if (this._styles._max === 0) { - Utils.insertCSSRule(this._styles, prefix, 'min-height: ' + getHeight(1, 0) + ';', 0); - } - - if (maxHeight > this._styles._max) { - for (var i = this._styles._max; i < maxHeight; ++i) { - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + getHeight(i + 1, i) + ';', - i - ); - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-min-height="' + (i + 1) + '"]', - 'min-height: ' + getHeight(i + 1, i) + ';', - i - ); - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-max-height="' + (i + 1) + '"]', - 'max-height: ' + getHeight(i + 1, i) + ';', - i - ); - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-y="' + i + '"]', - 'top: ' + getHeight(i, i) + ';', - i - ); - } - this._styles._max = maxHeight; - } - }; - - GridStack.prototype._updateContainerHeight = function() { - if (this.grid._updateCounter) { - return; - } - var height = this.grid.getGridHeight(); - var minHeight = parseInt(this.container.css('min-height')) / this.cellHeight(); - if (height < minHeight) { - height = minHeight; - } - this.container.attr('data-gs-current-height', height); - if (!this.opts.cellHeight) { - return ; - } - if (!this.opts.verticalMargin) { - this.container.css('height', (height * (this.opts.cellHeight)) + this.opts.cellHeightUnit); - } else if (this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { - this.container.css('height', (height * (this.opts.cellHeight + this.opts.verticalMargin) - - this.opts.verticalMargin) + this.opts.cellHeightUnit); - } else { - this.container.css('height', 'calc(' + ((height * (this.opts.cellHeight)) + this.opts.cellHeightUnit) + - ' + ' + ((height * (this.opts.verticalMargin - 1)) + this.opts.verticalMarginUnit) + ')'); - } - }; - - GridStack.prototype._isOneColumnMode = function() { - return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= - this.opts.minWidth; - }; - - GridStack.prototype._setupRemovingTimeout = function(el) { - var self = this; - var node = $(el).data('_gridstack_node'); - - if (node._removeTimeout || !self.opts.removable) { - return; - } - node._removeTimeout = setTimeout(function() { - el.addClass('grid-stack-item-removing'); - node._isAboutToRemove = true; - }, self.opts.removeTimeout); - }; - - GridStack.prototype._clearRemovingTimeout = function(el) { - var node = $(el).data('_gridstack_node'); - - if (!node._removeTimeout) { - return; - } - clearTimeout(node._removeTimeout); - node._removeTimeout = null; - el.removeClass('grid-stack-item-removing'); - node._isAboutToRemove = false; - }; - - GridStack.prototype._prepareElementsByNode = function(el, node) { - var self = this; - - var cellWidth; - var cellHeight; - - var dragOrResize = function(event, ui) { - var x = Math.round(ui.position.left / cellWidth); - var y = Math.floor((ui.position.top + cellHeight / 2) / cellHeight); - var width; - var height; - - if (event.type != 'drag') { - width = Math.round(ui.size.width / cellWidth); - height = Math.round(ui.size.height / cellHeight); - } - - if (event.type == 'drag') { - if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 || - (!self.grid.float && y > self.grid.getGridHeight())) { - if (!node._temporaryRemoved) { - if (self.opts.removable === true) { - self._setupRemovingTimeout(el); - } - - x = node._beforeDragX; - y = node._beforeDragY; - - self.placeholder.detach(); - self.placeholder.hide(); - self.grid.removeNode(node); - self._updateContainerHeight(); - - node._temporaryRemoved = true; - } - } else { - self._clearRemovingTimeout(el); - - if (node._temporaryRemoved) { - self.grid.addNode(node); - self.placeholder - .attr('data-gs-x', x) - .attr('data-gs-y', y) - .attr('data-gs-width', width) - .attr('data-gs-height', height) - .show(); - self.container.append(self.placeholder); - node.el = self.placeholder; - node._temporaryRemoved = false; - } - } - } else if (event.type == 'resize') { - if (x < 0) { - return; - } - } - // width and height are undefined if not resizing - var lastTriedWidth = typeof width !== 'undefined' ? width : node.lastTriedWidth; - var lastTriedHeight = typeof height !== 'undefined' ? height : node.lastTriedHeight; - if (!self.grid.canMoveNode(node, x, y, width, height) || - (node.lastTriedX === x && node.lastTriedY === y && - node.lastTriedWidth === lastTriedWidth && node.lastTriedHeight === lastTriedHeight)) { - return; - } - node.lastTriedX = x; - node.lastTriedY = y; - node.lastTriedWidth = width; - node.lastTriedHeight = height; - self.grid.moveNode(node, x, y, width, height); - self._updateContainerHeight(); - }; - - var onStartMoving = function(event, ui) { - self.container.append(self.placeholder); - var o = $(this); - self.grid.cleanNodes(); - self.grid.beginUpdate(node); - cellWidth = self.cellWidth(); - var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height')); - cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height')); - self.placeholder - .attr('data-gs-x', o.attr('data-gs-x')) - .attr('data-gs-y', o.attr('data-gs-y')) - .attr('data-gs-width', o.attr('data-gs-width')) - .attr('data-gs-height', o.attr('data-gs-height')) - .show(); - node.el = self.placeholder; - node._beforeDragX = node.x; - node._beforeDragY = node.y; - - self.dd.resizable(el, 'option', 'minWidth', cellWidth * (node.minWidth || 1)); - self.dd.resizable(el, 'option', 'minHeight', strictCellHeight * (node.minHeight || 1)); - - if (event.type == 'resizestart') { - o.find('.grid-stack-item').trigger('resizestart'); - } - }; - - var onEndMoving = function(event, ui) { - var o = $(this); - if (!o.data('_gridstack_node')) { - return; - } - - var forceNotify = false; - self.placeholder.detach(); - node.el = o; - self.placeholder.hide(); - - if (node._isAboutToRemove) { - forceNotify = true; - var gridToNotify = el.data('_gridstack_node')._grid; - gridToNotify._triggerRemoveEvent(); - el.removeData('_gridstack_node'); - el.remove(); - } else { - self._clearRemovingTimeout(el); - if (!node._temporaryRemoved) { - Utils.removePositioningStyles(o); - o - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height); - } else { - Utils.removePositioningStyles(o); - o - .attr('data-gs-x', node._beforeDragX) - .attr('data-gs-y', node._beforeDragY) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height); - node.x = node._beforeDragX; - node.y = node._beforeDragY; - self.grid.addNode(node); - } - } - self._updateContainerHeight(); - self._triggerChangeEvent(forceNotify); - - self.grid.endUpdate(); - - var nestedGrids = o.find('.grid-stack'); - if (nestedGrids.length && event.type == 'resizestop') { - nestedGrids.each(function(index, el) { - $(el).data('gridstack').onResizeHandler(); - }); - o.find('.grid-stack-item').trigger('resizestop'); - o.find('.grid-stack-item').trigger('gsresizestop'); - } - if (event.type == 'resizestop') { - self.container.trigger('gsresizestop', o); - } - }; - - this.dd - .draggable(el, { - start: onStartMoving, - stop: onEndMoving, - drag: dragOrResize - }) - .resizable(el, { - start: onStartMoving, - stop: onEndMoving, - resize: dragOrResize - }); - - if (node.noMove || (this._isOneColumnMode() && !self.opts.disableOneColumnMode) || this.opts.disableDrag || - this.opts.staticGrid) { - this.dd.draggable(el, 'disable'); - } - - if (node.noResize || (this._isOneColumnMode() && !self.opts.disableOneColumnMode) || this.opts.disableResize || - this.opts.staticGrid) { - this.dd.resizable(el, 'disable'); - } - - el.attr('data-gs-locked', node.locked ? 'yes' : null); - }; - - GridStack.prototype._prepareElement = function(el, triggerAddEvent) { - triggerAddEvent = typeof triggerAddEvent != 'undefined' ? triggerAddEvent : false; - var self = this; - el = $(el); - - el.addClass(this.opts.itemClass); - var node = self.grid.addNode({ - x: el.attr('data-gs-x'), - y: el.attr('data-gs-y'), - width: el.attr('data-gs-width'), - height: el.attr('data-gs-height'), - maxWidth: el.attr('data-gs-max-width'), - minWidth: el.attr('data-gs-min-width'), - maxHeight: el.attr('data-gs-max-height'), - minHeight: el.attr('data-gs-min-height'), - autoPosition: Utils.toBool(el.attr('data-gs-auto-position')), - noResize: Utils.toBool(el.attr('data-gs-no-resize')), - noMove: Utils.toBool(el.attr('data-gs-no-move')), - locked: Utils.toBool(el.attr('data-gs-locked')), - resizeHandles: el.attr('data-gs-resize-handles'), - el: el, - id: el.attr('data-gs-id'), - _grid: self - }, triggerAddEvent); - el.data('_gridstack_node', node); - - this._prepareElementsByNode(el, node); - }; - - GridStack.prototype.setAnimation = function(enable) { - if (enable) { - this.container.addClass('grid-stack-animate'); - } else { - this.container.removeClass('grid-stack-animate'); - } - }; - - GridStack.prototype.addWidget = function(el, x, y, width, height, autoPosition, minWidth, maxWidth, - minHeight, maxHeight, id) { - el = $(el); - if (typeof x != 'undefined') { el.attr('data-gs-x', x); } - if (typeof y != 'undefined') { el.attr('data-gs-y', y); } - if (typeof width != 'undefined') { el.attr('data-gs-width', width); } - if (typeof height != 'undefined') { el.attr('data-gs-height', height); } - if (typeof autoPosition != 'undefined') { el.attr('data-gs-auto-position', autoPosition ? 'yes' : null); } - if (typeof minWidth != 'undefined') { el.attr('data-gs-min-width', minWidth); } - if (typeof maxWidth != 'undefined') { el.attr('data-gs-max-width', maxWidth); } - if (typeof minHeight != 'undefined') { el.attr('data-gs-min-height', minHeight); } - if (typeof maxHeight != 'undefined') { el.attr('data-gs-max-height', maxHeight); } - if (typeof id != 'undefined') { el.attr('data-gs-id', id); } - this.container.append(el); - this._prepareElement(el, true); - this._triggerAddEvent(); - this._updateContainerHeight(); - this._triggerChangeEvent(true); - - return el; - }; - - GridStack.prototype.makeWidget = function(el) { - el = $(el); - this._prepareElement(el, true); - this._triggerAddEvent(); - this._updateContainerHeight(); - this._triggerChangeEvent(true); - - return el; - }; - - GridStack.prototype.willItFit = function(x, y, width, height, autoPosition) { - var node = {x: x, y: y, width: width, height: height, autoPosition: autoPosition}; - return this.grid.canBePlacedWithRespectToHeight(node); - }; - - GridStack.prototype.removeWidget = function(el, detachNode) { - detachNode = typeof detachNode === 'undefined' ? true : detachNode; - el = $(el); - var node = el.data('_gridstack_node'); - - // For Meteor support: https://github.com/troolee/gridstack.js/pull/272 - if (!node) { - node = this.grid.getNodeDataByDOMEl(el); - } - - this.grid.removeNode(node, detachNode); - el.removeData('_gridstack_node'); - this._updateContainerHeight(); - if (detachNode) { - el.remove(); - } - this._triggerChangeEvent(true); - this._triggerRemoveEvent(); - }; - - GridStack.prototype.removeAll = function(detachNode) { - _.each(this.grid.nodes, _.bind(function(node) { - this.removeWidget(node.el, detachNode); - }, this)); - this.grid.nodes = []; - this._updateContainerHeight(); - }; - - GridStack.prototype.destroy = function(detachGrid) { - $(window).off('resize', this.onResizeHandler); - this.disable(); - if (typeof detachGrid != 'undefined' && !detachGrid) { - this.removeAll(false); - this.container.removeData('gridstack'); - } else { - this.container.remove(); - } - Utils.removeStylesheet(this._stylesId); - if (this.grid) { - this.grid = null; - } - }; - - GridStack.prototype.resizable = function(el, val) { - var self = this; - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - node.noResize = !(val || false); - if (node.noResize || (self._isOneColumnMode() && !self.opts.disableOneColumnMode)) { - self.dd.resizable(el, 'disable'); - } else { - self.dd.resizable(el, 'enable'); - } - }); - return this; - }; - - GridStack.prototype.movable = function(el, val) { - var self = this; - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - node.noMove = !(val || false); - if (node.noMove || (self._isOneColumnMode() && !self.opts.disableOneColumnMode)) { - self.dd.draggable(el, 'disable'); - el.removeClass('ui-draggable-handle'); - } else { - self.dd.draggable(el, 'enable'); - el.addClass('ui-draggable-handle'); - } - }); - return this; - }; - - GridStack.prototype.enableMove = function(doEnable, includeNewWidgets) { - this.movable(this.container.children('.' + this.opts.itemClass), doEnable); - if (includeNewWidgets) { - this.opts.disableDrag = !doEnable; - } - }; - - GridStack.prototype.enableResize = function(doEnable, includeNewWidgets) { - this.resizable(this.container.children('.' + this.opts.itemClass), doEnable); - if (includeNewWidgets) { - this.opts.disableResize = !doEnable; - } - }; - - GridStack.prototype.disable = function() { - this.movable(this.container.children('.' + this.opts.itemClass), false); - this.resizable(this.container.children('.' + this.opts.itemClass), false); - this.container.trigger('disable'); - }; - - GridStack.prototype.enable = function() { - this.movable(this.container.children('.' + this.opts.itemClass), true); - this.resizable(this.container.children('.' + this.opts.itemClass), true); - this.container.trigger('enable'); - }; - - GridStack.prototype.locked = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - node.locked = (val || false); - el.attr('data-gs-locked', node.locked ? 'yes' : null); - }); - return this; - }; - - GridStack.prototype.maxHeight = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.maxHeight = (val || false); - el.attr('data-gs-max-height', val); - } - }); - return this; - }; - - GridStack.prototype.minHeight = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.minHeight = (val || false); - el.attr('data-gs-min-height', val); - } - }); - return this; - }; - - GridStack.prototype.maxWidth = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.maxWidth = (val || false); - el.attr('data-gs-max-width', val); - } - }); - return this; - }; - - GridStack.prototype.minWidth = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.minWidth = (val || false); - el.attr('data-gs-min-width', val); - } - }); - return this; - }; - - GridStack.prototype._updateElement = function(el, callback) { - el = $(el).first(); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - var self = this; - - self.grid.cleanNodes(); - self.grid.beginUpdate(node); - - callback.call(this, el, node); - - self._updateContainerHeight(); - self._triggerChangeEvent(); - - self.grid.endUpdate(); - }; - - GridStack.prototype.resize = function(el, width, height) { - this._updateElement(el, function(el, node) { - width = (width !== null && typeof width != 'undefined') ? width : node.width; - height = (height !== null && typeof height != 'undefined') ? height : node.height; - - this.grid.moveNode(node, node.x, node.y, width, height); - }); - }; - - GridStack.prototype.move = function(el, x, y) { - this._updateElement(el, function(el, node) { - x = (x !== null && typeof x != 'undefined') ? x : node.x; - y = (y !== null && typeof y != 'undefined') ? y : node.y; - - this.grid.moveNode(node, x, y, node.width, node.height); - }); - }; - - GridStack.prototype.update = function(el, x, y, width, height) { - this._updateElement(el, function(el, node) { - x = (x !== null && typeof x != 'undefined') ? x : node.x; - y = (y !== null && typeof y != 'undefined') ? y : node.y; - width = (width !== null && typeof width != 'undefined') ? width : node.width; - height = (height !== null && typeof height != 'undefined') ? height : node.height; - - this.grid.moveNode(node, x, y, width, height); - }); - }; - - GridStack.prototype.verticalMargin = function(val, noUpdate) { - if (typeof val == 'undefined') { - return this.opts.verticalMargin; - } - - var heightData = Utils.parseHeight(val); - - if (this.opts.verticalMarginUnit === heightData.unit && this.opts.height === heightData.height) { - return ; - } - this.opts.verticalMarginUnit = heightData.unit; - this.opts.verticalMargin = heightData.height; - - if (!noUpdate) { - this._updateStyles(); - } - }; - - GridStack.prototype.cellHeight = function(val, noUpdate) { - if (typeof val == 'undefined') { - if (this.opts.cellHeight) { - return this.opts.cellHeight; - } - var o = this.container.children('.' + this.opts.itemClass).first(); - return Math.ceil(o.outerHeight() / o.attr('data-gs-height')); - } - var heightData = Utils.parseHeight(val); - - if (this.opts.cellHeightUnit === heightData.heightUnit && this.opts.height === heightData.height) { - return ; - } - this.opts.cellHeightUnit = heightData.unit; - this.opts.cellHeight = heightData.height; - - if (!noUpdate) { - this._updateStyles(); - } - - }; - - GridStack.prototype.cellWidth = function() { - return Math.round(this.container.outerWidth() / this.opts.width); - }; - - GridStack.prototype.getCellFromPixel = function(position, useOffset) { - var containerPos = (typeof useOffset != 'undefined' && useOffset) ? - this.container.offset() : this.container.position(); - var relativeLeft = position.left - containerPos.left; - var relativeTop = position.top - containerPos.top; - - var columnWidth = Math.floor(this.container.width() / this.opts.width); - var rowHeight = Math.floor(this.container.height() / parseInt(this.container.attr('data-gs-current-height'))); - - return {x: Math.floor(relativeLeft / columnWidth), y: Math.floor(relativeTop / rowHeight)}; - }; - - GridStack.prototype.batchUpdate = function() { - this.grid.batchUpdate(); - }; - - GridStack.prototype.commit = function() { - this.grid.commit(); - this._updateContainerHeight(); - }; - - GridStack.prototype.isAreaEmpty = function(x, y, width, height) { - return this.grid.isAreaEmpty(x, y, width, height); - }; - - GridStack.prototype.setStatic = function(staticValue) { - this.opts.staticGrid = (staticValue === true); - this.enableMove(!staticValue); - this.enableResize(!staticValue); - this._setStaticClass(); - }; - - GridStack.prototype._setStaticClass = function() { - var staticClassName = 'grid-stack-static'; - - if (this.opts.staticGrid === true) { - this.container.addClass(staticClassName); - } else { - this.container.removeClass(staticClassName); - } - }; - - GridStack.prototype._updateNodeWidths = function(oldWidth, newWidth) { - this.grid._sortNodes(); - this.grid.batchUpdate(); - var node = {}; - for (var i = 0; i < this.grid.nodes.length; i++) { - node = this.grid.nodes[i]; - this.update(node.el, Math.round(node.x * newWidth / oldWidth), undefined, - Math.round(node.width * newWidth / oldWidth), undefined); - } - this.grid.commit(); - }; - - GridStack.prototype.setGridWidth = function(gridWidth,doNotPropagate) { - this.container.removeClass('grid-stack-' + this.opts.width); - if (doNotPropagate !== true) { - this._updateNodeWidths(this.opts.width, gridWidth); - } - this.opts.width = gridWidth; - this.grid.width = gridWidth; - this.container.addClass('grid-stack-' + gridWidth); - }; - - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - GridStackEngine.prototype.batch_update = obsolete(GridStackEngine.prototype.batchUpdate); - GridStackEngine.prototype._fix_collisions = obsolete(GridStackEngine.prototype._fixCollisions, - '_fix_collisions', '_fixCollisions'); - GridStackEngine.prototype.is_area_empty = obsolete(GridStackEngine.prototype.isAreaEmpty, - 'is_area_empty', 'isAreaEmpty'); - GridStackEngine.prototype._sort_nodes = obsolete(GridStackEngine.prototype._sortNodes, - '_sort_nodes', '_sortNodes'); - GridStackEngine.prototype._pack_nodes = obsolete(GridStackEngine.prototype._packNodes, - '_pack_nodes', '_packNodes'); - GridStackEngine.prototype._prepare_node = obsolete(GridStackEngine.prototype._prepareNode, - '_prepare_node', '_prepareNode'); - GridStackEngine.prototype.clean_nodes = obsolete(GridStackEngine.prototype.cleanNodes, - 'clean_nodes', 'cleanNodes'); - GridStackEngine.prototype.get_dirty_nodes = obsolete(GridStackEngine.prototype.getDirtyNodes, - 'get_dirty_nodes', 'getDirtyNodes'); - GridStackEngine.prototype.add_node = obsolete(GridStackEngine.prototype.addNode, - 'add_node', 'addNode, '); - GridStackEngine.prototype.remove_node = obsolete(GridStackEngine.prototype.removeNode, - 'remove_node', 'removeNode'); - GridStackEngine.prototype.can_move_node = obsolete(GridStackEngine.prototype.canMoveNode, - 'can_move_node', 'canMoveNode'); - GridStackEngine.prototype.move_node = obsolete(GridStackEngine.prototype.moveNode, - 'move_node', 'moveNode'); - GridStackEngine.prototype.get_grid_height = obsolete(GridStackEngine.prototype.getGridHeight, - 'get_grid_height', 'getGridHeight'); - GridStackEngine.prototype.begin_update = obsolete(GridStackEngine.prototype.beginUpdate, - 'begin_update', 'beginUpdate'); - GridStackEngine.prototype.end_update = obsolete(GridStackEngine.prototype.endUpdate, - 'end_update', 'endUpdate'); - GridStackEngine.prototype.can_be_placed_with_respect_to_height = - obsolete(GridStackEngine.prototype.canBePlacedWithRespectToHeight, - 'can_be_placed_with_respect_to_height', 'canBePlacedWithRespectToHeight'); - GridStack.prototype._trigger_change_event = obsolete(GridStack.prototype._triggerChangeEvent, - '_trigger_change_event', '_triggerChangeEvent'); - GridStack.prototype._init_styles = obsolete(GridStack.prototype._initStyles, - '_init_styles', '_initStyles'); - GridStack.prototype._update_styles = obsolete(GridStack.prototype._updateStyles, - '_update_styles', '_updateStyles'); - GridStack.prototype._update_container_height = obsolete(GridStack.prototype._updateContainerHeight, - '_update_container_height', '_updateContainerHeight'); - GridStack.prototype._is_one_column_mode = obsolete(GridStack.prototype._isOneColumnMode, - '_is_one_column_mode','_isOneColumnMode'); - GridStack.prototype._prepare_element = obsolete(GridStack.prototype._prepareElement, - '_prepare_element', '_prepareElement'); - GridStack.prototype.set_animation = obsolete(GridStack.prototype.setAnimation, - 'set_animation', 'setAnimation'); - GridStack.prototype.add_widget = obsolete(GridStack.prototype.addWidget, - 'add_widget', 'addWidget'); - GridStack.prototype.make_widget = obsolete(GridStack.prototype.makeWidget, - 'make_widget', 'makeWidget'); - GridStack.prototype.will_it_fit = obsolete(GridStack.prototype.willItFit, - 'will_it_fit', 'willItFit'); - GridStack.prototype.remove_widget = obsolete(GridStack.prototype.removeWidget, - 'remove_widget', 'removeWidget'); - GridStack.prototype.remove_all = obsolete(GridStack.prototype.removeAll, - 'remove_all', 'removeAll'); - GridStack.prototype.min_height = obsolete(GridStack.prototype.minHeight, - 'min_height', 'minHeight'); - GridStack.prototype.min_width = obsolete(GridStack.prototype.minWidth, - 'min_width', 'minWidth'); - GridStack.prototype._update_element = obsolete(GridStack.prototype._updateElement, - '_update_element', '_updateElement'); - GridStack.prototype.cell_height = obsolete(GridStack.prototype.cellHeight, - 'cell_height', 'cellHeight'); - GridStack.prototype.cell_width = obsolete(GridStack.prototype.cellWidth, - 'cell_width', 'cellWidth'); - GridStack.prototype.get_cell_from_pixel = obsolete(GridStack.prototype.getCellFromPixel, - 'get_cell_from_pixel', 'getCellFromPixel'); - GridStack.prototype.batch_update = obsolete(GridStack.prototype.batchUpdate, - 'batch_update', 'batchUpdate'); - GridStack.prototype.is_area_empty = obsolete(GridStack.prototype.isAreaEmpty, - 'is_area_empty', 'isAreaEmpty'); - GridStack.prototype.set_static = obsolete(GridStack.prototype.setStatic, - 'set_static', 'setStatic'); - GridStack.prototype._set_static_class = obsolete(GridStack.prototype._setStaticClass, - '_set_static_class', '_setStaticClass'); - // jscs:enable requireCamelCaseOrUpperCaseIdentifiers - - scope.GridStackUI = GridStack; - - scope.GridStackUI.Utils = Utils; - scope.GridStackUI.Engine = GridStackEngine; - scope.GridStackUI.GridStackDragDropPlugin = GridStackDragDropPlugin; - - $.fn.gridstack = function(opts) { - return this.each(function() { - var o = $(this); - if (!o.data('gridstack')) { - o - .data('gridstack', new GridStack(this, opts)); - } - }); - }; - - return scope.GridStackUI; -}); diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css deleted file mode 100644 index 79ada45df..000000000 --- a/dist/gridstack.min.css +++ /dev/null @@ -1 +0,0 @@ -:root .grid-stack-item>.ui-resizable-handle{filter:none}.grid-stack{position:relative}.grid-stack.grid-stack-rtl{direction:ltr}.grid-stack.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack .grid-stack-placeholder>.placeholder-content{border:1px dashed #d3d3d3;margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;text-align:center}.grid-stack>.grid-stack-item{min-width:8.3333333333%;position:absolute;padding:0}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack>.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack>.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack>.grid-stack-item.ui-draggable-dragging,.grid-stack>.grid-stack-item.ui-resizable-resizing{z-index:100}.grid-stack>.grid-stack-item.ui-draggable-dragging>.grid-stack-item-content,.grid-stack>.grid-stack-item.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,.2);opacity:.8}.grid-stack>.grid-stack-item>.ui-resizable-se,.grid-stack>.grid-stack-item>.ui-resizable-sw{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);background-repeat:no-repeat;background-position:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.grid-stack>.grid-stack-item>.ui-resizable-se{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.grid-stack>.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;left:10px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:0;left:25px;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;right:10px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;right:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item>.ui-resizable-se{cursor:se-resize;width:20px;height:20px;right:10px;bottom:0}.grid-stack>.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:0;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px;left:10px;bottom:0}.grid-stack>.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;left:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none!important}.grid-stack>.grid-stack-item[data-gs-width='1']{width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='3']{width:25%}.grid-stack>.grid-stack-item[data-gs-x='3']{left:25%}.grid-stack>.grid-stack-item[data-gs-min-width='3']{min-width:25%}.grid-stack>.grid-stack-item[data-gs-max-width='3']{max-width:25%}.grid-stack>.grid-stack-item[data-gs-width='4']{width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='6']{width:50%}.grid-stack>.grid-stack-item[data-gs-x='6']{left:50%}.grid-stack>.grid-stack-item[data-gs-min-width='6']{min-width:50%}.grid-stack>.grid-stack-item[data-gs-max-width='6']{max-width:50%}.grid-stack>.grid-stack-item[data-gs-width='7']{width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='9']{width:75%}.grid-stack>.grid-stack-item[data-gs-x='9']{left:75%}.grid-stack>.grid-stack-item[data-gs-min-width='9']{min-width:75%}.grid-stack>.grid-stack-item[data-gs-max-width='9']{max-width:75%}.grid-stack>.grid-stack-item[data-gs-width='10']{width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='12']{width:100%}.grid-stack>.grid-stack-item[data-gs-x='12']{left:100%}.grid-stack>.grid-stack-item[data-gs-min-width='12']{min-width:100%}.grid-stack>.grid-stack-item[data-gs-max-width='12']{max-width:100%}.grid-stack.grid-stack-animate,.grid-stack.grid-stack-animate .grid-stack-item{-webkit-transition:left .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:left .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .3s}.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing{-webkit-transition:left 0s,top 0s,height 0s,width 0s;-moz-transition:left 0s,top 0s,height 0s,width 0s;-ms-transition:left 0s,top 0s,height 0s,width 0s;-o-transition:left 0s,top 0s,height 0s,width 0s;transition:left 0s,top 0s,height 0s,width 0s}.grid-stack.grid-stack-one-column-mode{height:auto!important}.grid-stack.grid-stack-one-column-mode>.grid-stack-item{position:relative!important;width:auto!important;left:0!important;top:auto!important;margin-bottom:20px;max-width:none!important}.grid-stack.grid-stack-one-column-mode>.grid-stack-item>.ui-resizable-handle{display:none} \ No newline at end of file diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js deleted file mode 100644 index df58b05c8..000000000 --- a/dist/gridstack.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(a){}try{_=require("lodash")}catch(a){}a(jQuery,_)}else a(jQuery,_)}(function(a,b){function c(a){this.grid=a}var d=window,e=function(a,b,c){var d=function(){return console.warn("gridstack.js: Function `"+b+"` is deprecated as of v0.2.5 and has been replaced with `"+c+"`. It will be **completely** removed in v1.0."),a.apply(this,arguments)};return d.prototype=a.prototype,d},f=function(a,b){console.warn("gridstack.js: Option `"+a+"` is deprecated as of v0.2.5 and has been replaced with `"+b+"`. It will be **completely** removed in v1.0.")},g={isIntercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(a,c,d){return d=d||b.chain(a).map(function(a){return a.x+a.width}).max().value(),c=-1!=c?1:-1,b.sortBy(a,function(a){return c*(a.x+a.y*d)})},createStylesheet:function(a){var b=document.createElement("style");return b.setAttribute("type","text/css"),b.setAttribute("data-gs-style-id",a),b.styleSheet?b.styleSheet.cssText="":b.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(b),b.sheet},removeStylesheet:function(b){a("STYLE[data-gs-style-id="+b+"]").remove()},insertCSSRule:function(a,b,c,d){"function"==typeof a.insertRule?a.insertRule(b+"{"+c+"}",d):"function"==typeof a.addRule&&a.addRule(b,c,d)},toBool:function(a){return"boolean"==typeof a?a:"string"==typeof a?!(""===(a=a.toLowerCase())||"no"==a||"false"==a||"0"==a):Boolean(a)},_collisionNodeCheck:function(a){return a!=this.node&&g.isIntercepted(a,this.nn)},_didCollide:function(a){return g.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_isAddNodeIntercepted:function(a){return g.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},a)},parseHeight:function(a){var c=a,d="px";if(c&&b.isString(c)){var e=c.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!e)throw new Error("Invalid height");d=e[2]||"px",c=parseFloat(e[1])}return{height:c,unit:d}},removePositioningStyles:function(a){var b=a[0].style;b.position&&b.removeProperty("position"),b.left&&b.removeProperty("left"),b.top&&b.removeProperty("top"),b.width&&b.removeProperty("width"),b.height&&b.removeProperty("height")}};g.is_intercepted=e(g.isIntercepted,"is_intercepted","isIntercepted"),g.create_stylesheet=e(g.createStylesheet,"create_stylesheet","createStylesheet"),g.remove_stylesheet=e(g.removeStylesheet,"remove_stylesheet","removeStylesheet"),g.insert_css_rule=e(g.insertCSSRule,"insert_css_rule","insertCSSRule"),c.registeredPlugins=[],c.registerPlugin=function(a){c.registeredPlugins.push(a)},c.prototype.resizable=function(a,b){return this},c.prototype.draggable=function(a,b){return this},c.prototype.droppable=function(a,b){return this},c.prototype.isDroppable=function(a){return!1},c.prototype.on=function(a,b,c){return this};var h=0,i=function(a,b,c,d,e){this.width=a,this.float=c||!1,this.height=d||0,this.nodes=e||[],this.onchange=b||function(){},this._updateCounter=0,this._float=this.float,this._addedNodes=[],this._removedNodes=[]};i.prototype.batchUpdate=function(){this._updateCounter=1,this.float=!0},i.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this.float=this._float,this._packNodes(),this._notify())},i.prototype.getNodeDataByDOMEl=function(a){return b.find(this.nodes,function(b){return a.get(0)===b.el.get(0)})},i.prototype._fixCollisions=function(a){this._sortNodes(-1);var c=a,d=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this.float||d||(c={x:0,y:a.y,width:this.width,height:a.height});;){var e=b.find(this.nodes,b.bind(g._collisionNodeCheck,{node:a,nn:c}));if(void 0===e)return;this.moveNode(e,e.x,a.y+a.height,e.width,e.height,!0)}},i.prototype.isAreaEmpty=function(a,c,d,e){var f={x:a||0,y:c||0,width:d||1,height:e||1},h=b.find(this.nodes,b.bind(function(a){return g.isIntercepted(a,f)},this));return null===h||void 0===h},i.prototype._sortNodes=function(a){this.nodes=g.sort(this.nodes,a,this.width)},i.prototype._packNodes=function(){this._sortNodes(),this.float?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&void 0!==a._origY&&a.y!=a._origY)for(var d=a.y;d>=a._origY;){var e=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e||(a._dirty=!0,a.y=d),--d}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var d=a.y-1,e=0===c;if(c>0){var f=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e=void 0===f}if(!e)break;a._dirty=a.y!=d,a.y=d}},this))},i.prototype._prepareNode=function(a,c){return a=b.defaults(a||{},{width:1,height:1,x:0,y:0}),a.x=parseInt(""+a.x),a.y=parseInt(""+a.y),a.width=parseInt(""+a.width),a.height=parseInt(""+a.height),a.autoPosition=a.autoPosition||!1,a.noResize=a.noResize||!1,a.noMove=a.noMove||!1,a.width>this.width?a.width=this.width:a.width<1&&(a.width=1),a.height<1&&(a.height=1),a.x<0&&(a.x=0),a.x+a.width>this.width&&(c?a.width=this.width-a.x:a.x=this.width-a.width),a.y<0&&(a.y=0),a},i.prototype._notify=function(){var a=Array.prototype.slice.call(arguments,0);if(a[0]=void 0===a[0]?[]:[a[0]],a[1]=void 0===a[1]||a[1],!this._updateCounter){var b=a[0].concat(this.getDirtyNodes());this.onchange(b,a[1])}},i.prototype.cleanNodes=function(){this._updateCounter||b.each(this.nodes,function(a){a._dirty=!1})},i.prototype.getDirtyNodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},i.prototype.addNode=function(a,c){if(a=this._prepareNode(a),void 0!==a.maxWidth&&(a.width=Math.min(a.width,a.maxWidth)),void 0!==a.maxHeight&&(a.height=Math.min(a.height,a.maxHeight)),void 0!==a.minWidth&&(a.width=Math.max(a.width,a.minWidth)),void 0!==a.minHeight&&(a.height=Math.max(a.height,a.minHeight)),a._id=++h,a._dirty=!0,a.autoPosition){this._sortNodes();for(var d=0;;++d){var e=d%this.width,f=Math.floor(d/this.width);if(!(e+a.width>this.width)&&!b.find(this.nodes,b.bind(g._isAddNodeIntercepted,{x:e,y:f,node:a}))){a.x=e,a.y=f;break}}}return this.nodes.push(a),void 0!==c&&c&&this._addedNodes.push(b.clone(a)),this._fixCollisions(a),this._packNodes(),this._notify(),a},i.prototype.removeNode=function(a,c){c=void 0===c||c,this._removedNodes.push(b.clone(a)),a._id=null,this.nodes=b.without(this.nodes,a),this._packNodes(),this._notify(a,c)},i.prototype.canMoveNode=function(c,d,e,f,g){if(!this.isNodeChangedPosition(c,d,e,f,g))return!1;var h=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!h)return!0;var j,k=new i(this.width,null,this.float,0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));if(void 0===j)return!0;k.moveNode(j,d,e,f,g);var l=!0;return h&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.getGridHeight()<=this.height),l},i.prototype.canBePlacedWithRespectToHeight=function(c){if(!this.height)return!0;var d=new i(this.width,null,this.float,0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.addNode(c),d.getGridHeight()<=this.height},i.prototype.isNodeChangedPosition=function(a,b,c,d,e){return"number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),void 0!==a.maxWidth&&(d=Math.min(d,a.maxWidth)),void 0!==a.maxHeight&&(e=Math.min(e,a.maxHeight)),void 0!==a.minWidth&&(d=Math.max(d,a.minWidth)),void 0!==a.minHeight&&(e=Math.max(e,a.minHeight)),a.x!=b||a.y!=c||a.width!=d||a.height!=e},i.prototype.moveNode=function(a,b,c,d,e,f){if(!this.isNodeChangedPosition(a,b,c,d,e))return a;if("number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),void 0!==a.maxWidth&&(d=Math.min(d,a.maxWidth)),void 0!==a.maxHeight&&(e=Math.min(e,a.maxHeight)),void 0!==a.minWidth&&(d=Math.max(d,a.minWidth)),void 0!==a.minHeight&&(e=Math.max(e,a.minHeight)),a.x==b&&a.y==c&&a.width==d&&a.height==e)return a;var g=a.width!=d;return a._dirty=!0,a.x=b,a.y=c,a.width=d,a.height=e,a.lastTriedX=b,a.lastTriedY=c,a.lastTriedWidth=d,a.lastTriedHeight=e,a=this._prepareNode(a,g),this._fixCollisions(a),f||(this._packNodes(),this._notify()),a},i.prototype.getGridHeight=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},i.prototype.beginUpdate=function(a){b.each(this.nodes,function(a){a._origY=a.y}),a._updating=!0},i.prototype.endUpdate=function(){b.each(this.nodes,function(a){a._origY=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var j=function(d,e){var h,j,k=this;e=e||{},this.container=a(d),void 0!==e.handle_class&&(e.handleClass=e.handle_class,f("handle_class","handleClass")),void 0!==e.item_class&&(e.itemClass=e.item_class,f("item_class","itemClass")),void 0!==e.placeholder_class&&(e.placeholderClass=e.placeholder_class,f("placeholder_class","placeholderClass")),void 0!==e.placeholder_text&&(e.placeholderText=e.placeholder_text,f("placeholder_text","placeholderText")),void 0!==e.cell_height&&(e.cellHeight=e.cell_height,f("cell_height","cellHeight")),void 0!==e.vertical_margin&&(e.verticalMargin=e.vertical_margin,f("vertical_margin","verticalMargin")),void 0!==e.min_width&&(e.minWidth=e.min_width,f("min_width","minWidth")),void 0!==e.static_grid&&(e.staticGrid=e.static_grid,f("static_grid","staticGrid")),void 0!==e.is_nested&&(e.isNested=e.is_nested,f("is_nested","isNested")),void 0!==e.always_show_resize_handle&&(e.alwaysShowResizeHandle=e.always_show_resize_handle,f("always_show_resize_handle","alwaysShowResizeHandle")),e.itemClass=e.itemClass||"grid-stack-item";var l=this.container.closest("."+e.itemClass).length>0;if(this.opts=b.defaults(e||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,float:!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:b.defaults(e.resizable||{},{autoHide:!e.alwaysShowResizeHandle,handles:"se"}),draggable:b.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:e.disableDrag||!1,disableResize:e.disableResize||!1,rtl:"auto",removable:!1,removableOptions:b.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||!1,oneColumnModeClass:e.oneColumnModeClass||"grid-stack-one-column-mode",ddPlugin:null}),!1===this.opts.ddPlugin?this.opts.ddPlugin=c:null===this.opts.ddPlugin&&(this.opts.ddPlugin=b.first(c.registeredPlugins)||c),this.dd=new this.opts.ddPlugin(this),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&&this.container.addClass("grid-stack-rtl"),this.opts.isNested=l,j="auto"===this.opts.cellHeight,j?k.cellHeight(k.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),l&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new i(this.opts.width,function(a,c){c=void 0===c||c;var d=0;b.each(a,function(a){c&&null===a._id?a.el&&a.el.remove():(a.el.attr("data-gs-x",a.x).attr("data-gs-y",a.y).attr("data-gs-width",a.width).attr("data-gs-height",a.height),d=Math.max(d,a.y+a.height))}),k._updateStyles(d+10)},this.opts.float,this.opts.height),this.opts.auto){var m=[],n=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(b,c){c=a(c),m.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*n.opts.width})}),b.chain(m).sortBy(function(a){return a.i}).each(function(a){k._prepareElement(a.el)}).value()}if(this.setAnimation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholderText+"
").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=b.throttle(function(){k.cellHeight(k.cellWidth(),!1)},100),this.onResizeHandler=function(){if(j&&k._updateHeightsOnResize(),k._isOneColumnMode()&&!k.opts.disableOneColumnMode){if(h)return;k.container.addClass(k.opts.oneColumnModeClass),h=!0,k.grid._sortNodes(),b.each(k.grid.nodes,function(a){k.container.append(a.el),k.opts.staticGrid||(k.dd.draggable(a.el,"disable"),k.dd.resizable(a.el,"disable"),a.el.trigger("resize"))})}else{if(!h)return;if(k.container.removeClass(k.opts.oneColumnModeClass),h=!1,k.opts.staticGrid)return;b.each(k.grid.nodes,function(a){a.noMove||k.opts.disableDrag||k.dd.draggable(a.el,"enable"),a.noResize||k.opts.disableResize||k.dd.resizable(a.el,"enable"),a.el.trigger("resize")})}},a(window).resize(this.onResizeHandler),this.onResizeHandler(),!k.opts.staticGrid&&"string"==typeof k.opts.removable){var o=a(k.opts.removable);this.dd.isDroppable(o)||this.dd.droppable(o,k.opts.removableOptions),this.dd.on(o,"dropover",function(b,c){var d=a(c.draggable);d.data("_gridstack_node")._grid===k&&(d.data("inTrashZone",!0),k._setupRemovingTimeout(d))}).on(o,"dropout",function(b,c){var d=a(c.draggable);d.data("_gridstack_node")._grid===k&&(d.data("inTrashZone",!1),k._clearRemovingTimeout(d))})}if(!k.opts.staticGrid&&k.opts.acceptWidgets){var p=null,q=function(a,b){var c=p,d=c.data("_gridstack_node"),e=k.getCellFromPixel({left:a.pageX,top:a.pageY},!0),f=Math.max(0,e.x),g=Math.max(0,e.y);d._added||(d._added=!0,d.el=c,d.autoPosition=!0,d.x=f,d.y=g,k.grid.cleanNodes(),k.grid.beginUpdate(d),k.grid.addNode(d),k.container.append(k.placeholder),k.placeholder.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).show(),d.el=k.placeholder,d._beforeDragX=d.x,d._beforeDragY=d.y,k._updateContainerHeight()),k.grid.canMoveNode(d,f,g)&&(k.grid.moveNode(d,f,g),k._updateContainerHeight())};this.dd.droppable(k.container,{accept:function(b){b=a(b);var c=b.data("_gridstack_node");return(!c||c._grid!==k)&&b.is(!0===k.opts.acceptWidgets?".grid-stack-item":k.opts.acceptWidgets)}}).on(k.container,"dropover",function(b,c){var d=(k.container.offset(),a(c.draggable)),e=k.cellWidth(),f=k.cellHeight(),g=d.data("_gridstack_node"),h=g?g.width:Math.ceil(d.outerWidth()/e),i=g?g.height:Math.ceil(d.outerHeight()/f);p=d;var j=k.grid._prepareNode({width:h,height:i,_added:!1,_temporary:!0});d.data("_gridstack_node",j),d.data("_gridstack_node_orig",g),d.on("drag",q)}).on(k.container,"dropout",function(b,c){var d=a(c.draggable);if(d.data("_gridstack_node")){d.unbind("drag",q);var e=d.data("_gridstack_node");e.el=null,k.grid.removeNode(e),k.placeholder.detach(),k._updateContainerHeight(),d.data("_gridstack_node",d.data("_gridstack_node_orig"))}}).on(k.container,"drop",function(b,c){k.placeholder.detach();var d=a(c.draggable).data("_gridstack_node");d._grid=k;var e=a(c.draggable).clone(!1);e.data("_gridstack_node",d);var f=a(c.draggable).data("_gridstack_node_orig");void 0!==f&&void 0!==f._grid&&f._grid._triggerRemoveEvent(),a(c.helper).remove(),d.el=e,k.placeholder.hide(),g.removePositioningStyles(e),e.find("div.ui-resizable-handle").remove(),e.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).addClass(k.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",q),k.container.append(e),k._prepareElementsByNode(e,d),k._updateContainerHeight(),k.grid._addedNodes.push(d),k._triggerAddEvent(),k._triggerChangeEvent(),k.grid.endUpdate(),a(c.draggable).unbind("drag",q),a(c.draggable).removeData("_gridstack_node"),a(c.draggable).removeData("_gridstack_node_orig")})}};return j.prototype._triggerChangeEvent=function(a){var b=this.grid.getDirtyNodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||!0===a)&&this.container.trigger("change",d)},j.prototype._triggerAddEvent=function(){this.grid._addedNodes&&this.grid._addedNodes.length>0&&(this.container.trigger("added",[b.map(this.grid._addedNodes,b.clone)]),this.grid._addedNodes=[])},j.prototype._triggerRemoveEvent=function(){this.grid._removedNodes&&this.grid._removedNodes.length>0&&(this.container.trigger("removed",[b.map(this.grid._removedNodes,b.clone)]),this.grid._removedNodes=[])},j.prototype._initStyles=function(){this._stylesId&&g.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=g.createStylesheet(this._stylesId),null!==this._styles&&(this._styles._max=0)},j.prototype._updateStyles=function(a){if(null!==this._styles&&void 0!==this._styles){var b,c="."+this.opts._class+" ."+this.opts.itemClass,d=this;if(void 0===a&&(a=this._styles._max),!(0!==this._styles._max&&a<=this._styles._max)&&(this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&(b=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(a,b){return a&&b?"calc("+(d.opts.cellHeight*a+d.opts.cellHeightUnit)+" + "+(d.opts.verticalMargin*b+d.opts.verticalMarginUnit)+")":d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit}:function(a,b){return d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit},0===this._styles._max&&g.insertCSSRule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max))){for(var e=this._styles._max;e=f.grid.width||k<0||!f.grid.float&&k>f.grid.getGridHeight()?c._temporaryRemoved||(!0===f.opts.removable&&f._setupRemovingTimeout(b),j=c._beforeDragX,k=c._beforeDragY,f.placeholder.detach(),f.placeholder.hide(),f.grid.removeNode(c),f._updateContainerHeight(),c._temporaryRemoved=!0):(f._clearRemovingTimeout(b),c._temporaryRemoved&&(f.grid.addNode(c),f.placeholder.attr("data-gs-x",j).attr("data-gs-y",k).attr("data-gs-width",h).attr("data-gs-height",i).show(),f.container.append(f.placeholder),c.el=f.placeholder,c._temporaryRemoved=!1));else if("resize"==a.type&&j<0)return;var l=void 0!==h?h:c.lastTriedWidth,m=void 0!==i?i:c.lastTriedHeight;!f.grid.canMoveNode(c,j,k,h,i)||c.lastTriedX===j&&c.lastTriedY===k&&c.lastTriedWidth===l&&c.lastTriedHeight===m||(c.lastTriedX=j,c.lastTriedY=k,c.lastTriedWidth=h,c.lastTriedHeight=i,f.grid.moveNode(c,j,k,h,i),f._updateContainerHeight())},i=function(g,h){f.container.append(f.placeholder);var i=a(this);f.grid.cleanNodes(),f.grid.beginUpdate(c),d=f.cellWidth();var j=Math.ceil(i.outerHeight()/i.attr("data-gs-height"));e=f.container.height()/parseInt(f.container.attr("data-gs-current-height")),f.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),c.el=f.placeholder,c._beforeDragX=c.x,c._beforeDragY=c.y,f.dd.resizable(b,"option","minWidth",d*(c.minWidth||1)),f.dd.resizable(b,"option","minHeight",j*(c.minHeight||1)),"resizestart"==g.type&&i.find(".grid-stack-item").trigger("resizestart")},j=function(d,e){var h=a(this);if(h.data("_gridstack_node")){var i=!1;if(f.placeholder.detach(),c.el=h,f.placeholder.hide(),c._isAboutToRemove){i=!0;b.data("_gridstack_node")._grid._triggerRemoveEvent(),b.removeData("_gridstack_node"),b.remove()}else f._clearRemovingTimeout(b),c._temporaryRemoved?(g.removePositioningStyles(h),h.attr("data-gs-x",c._beforeDragX).attr("data-gs-y",c._beforeDragY).attr("data-gs-width",c.width).attr("data-gs-height",c.height),c.x=c._beforeDragX,c.y=c._beforeDragY,f.grid.addNode(c)):(g.removePositioningStyles(h),h.attr("data-gs-x",c.x).attr("data-gs-y",c.y).attr("data-gs-width",c.width).attr("data-gs-height",c.height));f._updateContainerHeight(),f._triggerChangeEvent(i),f.grid.endUpdate();var j=h.find(".grid-stack");j.length&&"resizestop"==d.type&&(j.each(function(b,c){a(c).data("gridstack").onResizeHandler()}),h.find(".grid-stack-item").trigger("resizestop"),h.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"==d.type&&f.container.trigger("gsresizestop",h)}};this.dd.draggable(b,{start:i,stop:j,drag:h}).resizable(b,{start:i,stop:j,resize:h}),(c.noMove||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(b,"disable"),(c.noResize||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(b,"disable"),b.attr("data-gs-locked",c.locked?"yes":null)},j.prototype._prepareElement=function(b,c){c=void 0!==c&&c;var d=this;b=a(b),b.addClass(this.opts.itemClass);var e=d.grid.addNode({x:b.attr("data-gs-x"),y:b.attr("data-gs-y"),width:b.attr("data-gs-width"),height:b.attr("data-gs-height"),maxWidth:b.attr("data-gs-max-width"),minWidth:b.attr("data-gs-min-width"),maxHeight:b.attr("data-gs-max-height"),minHeight:b.attr("data-gs-min-height"),autoPosition:g.toBool(b.attr("data-gs-auto-position")),noResize:g.toBool(b.attr("data-gs-no-resize")),noMove:g.toBool(b.attr("data-gs-no-move")),locked:g.toBool(b.attr("data-gs-locked")),resizeHandles:b.attr("data-gs-resize-handles"),el:b,id:b.attr("data-gs-id"),_grid:d},c);b.data("_gridstack_node",e),this._prepareElementsByNode(b,e)},j.prototype.setAnimation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},j.prototype.addWidget=function(b,c,d,e,f,g,h,i,j,k,l){return b=a(b),void 0!==c&&b.attr("data-gs-x",c),void 0!==d&&b.attr("data-gs-y",d),void 0!==e&&b.attr("data-gs-width",e),void 0!==f&&b.attr("data-gs-height",f),void 0!==g&&b.attr("data-gs-auto-position",g?"yes":null),void 0!==h&&b.attr("data-gs-min-width",h),void 0!==i&&b.attr("data-gs-max-width",i),void 0!==j&&b.attr("data-gs-min-height",j),void 0!==k&&b.attr("data-gs-max-height",k),void 0!==l&&b.attr("data-gs-id",l),this.container.append(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.makeWidget=function(b){return b=a(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.willItFit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,autoPosition:e};return this.grid.canBePlacedWithRespectToHeight(f)},j.prototype.removeWidget=function(b,c){c=void 0===c||c,b=a(b);var d=b.data("_gridstack_node");d||(d=this.grid.getNodeDataByDOMEl(b)),this.grid.removeNode(d,c),b.removeData("_gridstack_node"),this._updateContainerHeight(),c&&b.remove(),this._triggerChangeEvent(!0),this._triggerRemoveEvent()},j.prototype.removeAll=function(a){b.each(this.grid.nodes,b.bind(function(b){this.removeWidget(b.el,a)},this)),this.grid.nodes=[],this._updateContainerHeight()},j.prototype.destroy=function(b){a(window).off("resize",this.onResizeHandler),this.disable(),void 0===b||b?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),g.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},j.prototype.resizable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");void 0!==f&&null!==f&&(f.noResize=!c,f.noResize||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?d.dd.resizable(e,"disable"):d.dd.resizable(e,"enable"))}),this},j.prototype.movable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");void 0!==f&&null!==f&&(f.noMove=!c,f.noMove||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?(d.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(d.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},j.prototype.enableMove=function(a,b){this.movable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableDrag=!a)},j.prototype.enableResize=function(a,b){this.resizable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableResize=!a)},j.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},j.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},j.prototype.locked=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(e.locked=c||!1,d.attr("data-gs-locked",e.locked?"yes":null))}),this},j.prototype.maxHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.maxHeight=c||!1,d.attr("data-gs-max-height",c)))}),this},j.prototype.minHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.minHeight=c||!1,d.attr("data-gs-min-height",c)))}),this},j.prototype.maxWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.maxWidth=c||!1,d.attr("data-gs-max-width",c)))}),this},j.prototype.minWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");void 0!==e&&null!==e&&(isNaN(c)||(e.minWidth=c||!1,d.attr("data-gs-min-width",c)))}),this},j.prototype._updateElement=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if(void 0!==d&&null!==d){var e=this;e.grid.cleanNodes(),e.grid.beginUpdate(d),c.call(this,b,d),e._updateContainerHeight(),e._triggerChangeEvent(),e.grid.endUpdate()}},j.prototype.resize=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&void 0!==b?b:d.width,c=null!==c&&void 0!==c?c:d.height,this.grid.moveNode(d,d.x,d.y,b,c)})},j.prototype.move=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&void 0!==b?b:d.x,c=null!==c&&void 0!==c?c:d.y,this.grid.moveNode(d,b,c,d.width,d.height)})},j.prototype.update=function(a,b,c,d,e){this._updateElement(a,function(a,f){b=null!==b&&void 0!==b?b:f.x,c=null!==c&&void 0!==c?c:f.y,d=null!==d&&void 0!==d?d:f.width,e=null!==e&&void 0!==e?e:f.height,this.grid.moveNode(f,b,c,d,e)})},j.prototype.verticalMargin=function(a,b){if(void 0===a)return this.opts.verticalMargin;var c=g.parseHeight(a);this.opts.verticalMarginUnit===c.unit&&this.opts.height===c.height||(this.opts.verticalMarginUnit=c.unit,this.opts.verticalMargin=c.height,b||this._updateStyles())},j.prototype.cellHeight=function(a,b){if(void 0===a){if(this.opts.cellHeight)return this.opts.cellHeight;var c=this.container.children("."+this.opts.itemClass).first();return Math.ceil(c.outerHeight()/c.attr("data-gs-height"))}var d=g.parseHeight(a);this.opts.cellHeightUnit===d.heightUnit&&this.opts.height===d.height||(this.opts.cellHeightUnit=d.unit,this.opts.cellHeight=d.height,b||this._updateStyles())},j.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.width)},j.prototype.getCellFromPixel=function(a,b){var c=void 0!==b&&b?this.container.offset():this.container.position(),d=a.left-c.left,e=a.top-c.top,f=Math.floor(this.container.width()/this.opts.width),g=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(d/f),y:Math.floor(e/g)}},j.prototype.batchUpdate=function(){this.grid.batchUpdate()},j.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},j.prototype.isAreaEmpty=function(a,b,c,d){return this.grid.isAreaEmpty(a,b,c,d)},j.prototype.setStatic=function(a){this.opts.staticGrid=!0===a,this.enableMove(!a),this.enableResize(!a),this._setStaticClass()},j.prototype._setStaticClass=function(){!0===this.opts.staticGrid?this.container.addClass("grid-stack-static"):this.container.removeClass("grid-stack-static")},j.prototype._updateNodeWidths=function(a,b){this.grid._sortNodes(),this.grid.batchUpdate();for(var c={},d=0;d Date: Wed, 13 Sep 2017 10:12:09 -0700 Subject: [PATCH 2/3] instead generate the output files during build process, so there is no conflict on merge or issue being out of sync. use 'build' target to generate before publishing npm (which I didn't see included) Bug Number: https://github.com/gridstack/gridstack.js/issues/776 --- .gitignore | 1 + dist/gridstack-extra.css | 1295 ----------------------- dist/gridstack-extra.min.css | 1 - dist/gridstack.all.js | 37 - dist/gridstack.css | 387 ------- dist/gridstack.jQueryUI.js | 95 -- dist/gridstack.jQueryUI.min.js | 13 - dist/gridstack.js | 1785 -------------------------------- dist/gridstack.min.css | 1 - dist/gridstack.min.js | 26 - dist/gridstack.min.map | 1 - package.json | 6 +- 12 files changed, 5 insertions(+), 3643 deletions(-) delete mode 100644 dist/gridstack-extra.css delete mode 100644 dist/gridstack-extra.min.css delete mode 100644 dist/gridstack.all.js delete mode 100644 dist/gridstack.css delete mode 100644 dist/gridstack.jQueryUI.js delete mode 100644 dist/gridstack.jQueryUI.min.js delete mode 100644 dist/gridstack.js delete mode 100644 dist/gridstack.min.css delete mode 100644 dist/gridstack.min.js delete mode 100644 dist/gridstack.min.map diff --git a/.gitignore b/.gitignore index 95ec03ef6..a3e22fcb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +dist node_modules bower_components coverage diff --git a/dist/gridstack-extra.css b/dist/gridstack-extra.css deleted file mode 100644 index 0f51e59b4..000000000 --- a/dist/gridstack-extra.css +++ /dev/null @@ -1,1295 +0,0 @@ -.grid-stack.grid-stack-1 > .grid-stack-item { - min-width: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-width='1'] { - width: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-x='1'] { - left: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 100%; -} - -.grid-stack.grid-stack-1 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item { - min-width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='1'] { - width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='1'] { - left: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 50%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-width='2'] { - width: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-x='2'] { - left: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 100%; -} - -.grid-stack.grid-stack-2 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='1'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='1'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='2'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='2'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='3'] { - width: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='3'] { - left: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 100%; -} - -.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item { - min-width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='1'] { - width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='1'] { - left: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 25%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='2'] { - width: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='2'] { - left: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 50%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='3'] { - width: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='3'] { - left: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 75%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-width='4'] { - width: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-x='4'] { - left: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 100%; -} - -.grid-stack.grid-stack-4 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item { - min-width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='1'] { - width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='1'] { - left: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 20%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='2'] { - width: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='2'] { - left: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 40%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='3'] { - width: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='3'] { - left: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 60%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='4'] { - width: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='4'] { - left: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 80%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-width='5'] { - width: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-x='5'] { - left: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 100%; -} - -.grid-stack.grid-stack-5 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item { - min-width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='1'] { - width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='1'] { - left: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 16.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='2'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='2'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='3'] { - width: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='3'] { - left: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 50%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='4'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='4'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='5'] { - width: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='5'] { - left: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 83.3333333333%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='6'] { - width: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='6'] { - left: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 100%; -} - -.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item { - min-width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='1'] { - width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='1'] { - left: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 14.2857142857%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='2'] { - width: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='2'] { - left: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 28.5714285714%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='3'] { - width: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='3'] { - left: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 42.8571428571%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='4'] { - width: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='4'] { - left: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 57.1428571429%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='5'] { - width: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='5'] { - left: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 71.4285714286%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='6'] { - width: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='6'] { - left: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 85.7142857143%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='7'] { - width: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='7'] { - left: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 100%; -} - -.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item { - min-width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='1'] { - width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='1'] { - left: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 12.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='2'] { - width: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='2'] { - left: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 25%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='3'] { - width: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='3'] { - left: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 37.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='4'] { - width: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='4'] { - left: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 50%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='5'] { - width: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='5'] { - left: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 62.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='6'] { - width: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='6'] { - left: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 75%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='7'] { - width: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='7'] { - left: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 87.5%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-width='8'] { - width: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-x='8'] { - left: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 100%; -} - -.grid-stack.grid-stack-8 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item { - min-width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='1'] { - width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='1'] { - left: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 11.1111111111%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='2'] { - width: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='2'] { - left: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 22.2222222222%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='3'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='3'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='4'] { - width: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='4'] { - left: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 44.4444444444%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='5'] { - width: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='5'] { - left: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 55.5555555556%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='6'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='6'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='7'] { - width: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='7'] { - left: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 77.7777777778%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='8'] { - width: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='8'] { - left: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 88.8888888889%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='9'] { - width: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='9'] { - left: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 100%; -} - -.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item { - min-width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='1'] { - width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='1'] { - left: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 10%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='2'] { - width: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='2'] { - left: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 20%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='3'] { - width: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='3'] { - left: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 30%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='4'] { - width: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='4'] { - left: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 40%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='5'] { - width: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='5'] { - left: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 50%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='6'] { - width: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='6'] { - left: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 60%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='7'] { - width: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='7'] { - left: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 70%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='8'] { - width: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='8'] { - left: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 80%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='9'] { - width: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='9'] { - left: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 90%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-width='10'] { - width: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-x='10'] { - left: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 100%; -} - -.grid-stack.grid-stack-10 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item { - min-width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='1'] { - width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='1'] { - left: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 9.0909090909%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='2'] { - width: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='2'] { - left: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 18.1818181818%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='3'] { - width: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='3'] { - left: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 27.2727272727%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='4'] { - width: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='4'] { - left: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 36.3636363636%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='5'] { - width: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='5'] { - left: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 45.4545454545%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='6'] { - width: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='6'] { - left: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 54.5454545455%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='7'] { - width: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='7'] { - left: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 63.6363636364%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='8'] { - width: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='8'] { - left: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 72.7272727273%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='9'] { - width: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='9'] { - left: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 81.8181818182%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='10'] { - width: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='10'] { - left: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 90.9090909091%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='11'] { - width: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='11'] { - left: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='11'] { - min-width: 100%; -} - -.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='11'] { - max-width: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item { - min-width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='1'] { - width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='1'] { - left: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='1'] { - min-width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='1'] { - max-width: 8.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='2'] { - width: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='2'] { - left: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='2'] { - min-width: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='2'] { - max-width: 16.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='3'] { - width: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='3'] { - left: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='3'] { - min-width: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='3'] { - max-width: 25%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='4'] { - width: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='4'] { - left: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='4'] { - min-width: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='4'] { - max-width: 33.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='5'] { - width: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='5'] { - left: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='5'] { - min-width: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='5'] { - max-width: 41.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='6'] { - width: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='6'] { - left: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='6'] { - min-width: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='6'] { - max-width: 50%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='7'] { - width: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='7'] { - left: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='7'] { - min-width: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='7'] { - max-width: 58.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='8'] { - width: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='8'] { - left: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='8'] { - min-width: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='8'] { - max-width: 66.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='9'] { - width: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='9'] { - left: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='9'] { - min-width: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='9'] { - max-width: 75%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='10'] { - width: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='10'] { - left: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='10'] { - min-width: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='10'] { - max-width: 83.3333333333%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='11'] { - width: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='11'] { - left: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='11'] { - min-width: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='11'] { - max-width: 91.6666666667%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='12'] { - width: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='12'] { - left: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='12'] { - min-width: 100%; -} - -.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='12'] { - max-width: 100%; -} diff --git a/dist/gridstack-extra.min.css b/dist/gridstack-extra.min.css deleted file mode 100644 index 074f4d56c..000000000 --- a/dist/gridstack-extra.min.css +++ /dev/null @@ -1 +0,0 @@ -.grid-stack.grid-stack-1>.grid-stack-item,.grid-stack.grid-stack-1>.grid-stack-item[data-gs-min-width='1']{min-width:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-width='1']{width:100%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-x='1']{left:100%}.grid-stack.grid-stack-2>.grid-stack-item,.grid-stack.grid-stack-2>.grid-stack-item[data-gs-min-width='1']{min-width:50%}.grid-stack.grid-stack-1>.grid-stack-item[data-gs-max-width='1']{max-width:100%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-width='1']{width:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-x='1']{left:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-max-width='1']{max-width:50%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-width='2']{width:100%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-x='2']{left:100%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-min-width='2']{min-width:100%}.grid-stack.grid-stack-3>.grid-stack-item,.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='1']{min-width:33.3333333333%}.grid-stack.grid-stack-2>.grid-stack-item[data-gs-max-width='2']{max-width:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='1']{width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='1']{left:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='1']{max-width:33.3333333333%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='2']{width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='2']{left:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='2']{min-width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='2']{max-width:66.6666666667%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-width='3']{width:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-x='3']{left:100%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-min-width='3']{min-width:100%}.grid-stack.grid-stack-4>.grid-stack-item,.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='1']{min-width:25%}.grid-stack.grid-stack-3>.grid-stack-item[data-gs-max-width='3']{max-width:100%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='1']{width:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='1']{left:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='1']{max-width:25%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='2']{width:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='2']{left:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='2']{min-width:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='2']{max-width:50%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='3']{width:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='3']{left:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='3']{min-width:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='3']{max-width:75%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-width='4']{width:100%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-x='4']{left:100%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-min-width='4']{min-width:100%}.grid-stack.grid-stack-5>.grid-stack-item,.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='1']{min-width:20%}.grid-stack.grid-stack-4>.grid-stack-item[data-gs-max-width='4']{max-width:100%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='1']{width:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='1']{left:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='1']{max-width:20%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='2']{width:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='2']{left:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='2']{min-width:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='2']{max-width:40%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='3']{width:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='3']{left:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='3']{min-width:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='3']{max-width:60%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='4']{width:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='4']{left:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='4']{min-width:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='4']{max-width:80%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-width='5']{width:100%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-x='5']{left:100%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-min-width='5']{min-width:100%}.grid-stack.grid-stack-6>.grid-stack-item,.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='1']{min-width:16.6666666667%}.grid-stack.grid-stack-5>.grid-stack-item[data-gs-max-width='5']{max-width:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='1']{width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='1']{left:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='1']{max-width:16.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='2']{width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='2']{left:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='2']{min-width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='2']{max-width:33.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='3']{width:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='3']{left:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='3']{min-width:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='3']{max-width:50%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='4']{width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='4']{left:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='4']{min-width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='4']{max-width:66.6666666667%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='5']{width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='5']{left:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='5']{min-width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='5']{max-width:83.3333333333%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-width='6']{width:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-x='6']{left:100%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-min-width='6']{min-width:100%}.grid-stack.grid-stack-7>.grid-stack-item,.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='1']{min-width:14.2857142857%}.grid-stack.grid-stack-6>.grid-stack-item[data-gs-max-width='6']{max-width:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='1']{width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='1']{left:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='1']{max-width:14.2857142857%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='2']{width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='2']{left:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='2']{min-width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='2']{max-width:28.5714285714%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='3']{width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='3']{left:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='3']{min-width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='3']{max-width:42.8571428571%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='4']{width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='4']{left:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='4']{min-width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='4']{max-width:57.1428571429%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='5']{width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='5']{left:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='5']{min-width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='5']{max-width:71.4285714286%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='6']{width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='6']{left:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='6']{min-width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='6']{max-width:85.7142857143%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-width='7']{width:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-x='7']{left:100%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-min-width='7']{min-width:100%}.grid-stack.grid-stack-8>.grid-stack-item,.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='1']{min-width:12.5%}.grid-stack.grid-stack-7>.grid-stack-item[data-gs-max-width='7']{max-width:100%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='1']{width:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='1']{left:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='1']{max-width:12.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='2']{width:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='2']{left:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='2']{min-width:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='2']{max-width:25%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='3']{width:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='3']{left:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='3']{min-width:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='3']{max-width:37.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='4']{width:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='4']{left:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='4']{min-width:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='4']{max-width:50%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='5']{width:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='5']{left:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='5']{min-width:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='5']{max-width:62.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='6']{width:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='6']{left:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='6']{min-width:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='6']{max-width:75%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='7']{width:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='7']{left:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='7']{min-width:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='7']{max-width:87.5%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-width='8']{width:100%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-x='8']{left:100%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-min-width='8']{min-width:100%}.grid-stack.grid-stack-9>.grid-stack-item,.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='1']{min-width:11.1111111111%}.grid-stack.grid-stack-8>.grid-stack-item[data-gs-max-width='8']{max-width:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='1']{width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='1']{left:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='1']{max-width:11.1111111111%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='2']{width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='2']{left:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='2']{min-width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='2']{max-width:22.2222222222%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='3']{width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='3']{left:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='3']{min-width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='3']{max-width:33.3333333333%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='4']{width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='4']{left:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='4']{min-width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='4']{max-width:44.4444444444%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='5']{width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='5']{left:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='5']{min-width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='5']{max-width:55.5555555556%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='6']{width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='6']{left:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='6']{min-width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='6']{max-width:66.6666666667%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='7']{width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='7']{left:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='7']{min-width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='7']{max-width:77.7777777778%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='8']{width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='8']{left:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='8']{min-width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='8']{max-width:88.8888888889%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-width='9']{width:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-x='9']{left:100%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-min-width='9']{min-width:100%}.grid-stack.grid-stack-10>.grid-stack-item,.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='1']{min-width:10%}.grid-stack.grid-stack-9>.grid-stack-item[data-gs-max-width='9']{max-width:100%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='1']{width:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='1']{left:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='1']{max-width:10%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='2']{width:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='2']{left:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='2']{min-width:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='2']{max-width:20%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='3']{width:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='3']{left:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='3']{min-width:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='3']{max-width:30%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='4']{width:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='4']{left:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='4']{min-width:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='4']{max-width:40%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='5']{width:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='5']{left:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='5']{min-width:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='5']{max-width:50%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='6']{width:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='6']{left:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='6']{min-width:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='6']{max-width:60%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='7']{width:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='7']{left:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='7']{min-width:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='7']{max-width:70%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='8']{width:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='8']{left:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='8']{min-width:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='8']{max-width:80%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='9']{width:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='9']{left:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='9']{min-width:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='9']{max-width:90%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-width='10']{width:100%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-x='10']{left:100%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-min-width='10']{min-width:100%}.grid-stack.grid-stack-11>.grid-stack-item,.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='1']{min-width:9.0909090909%}.grid-stack.grid-stack-10>.grid-stack-item[data-gs-max-width='10']{max-width:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='1']{width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='1']{left:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='1']{max-width:9.0909090909%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='2']{width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='2']{left:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='2']{min-width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='2']{max-width:18.1818181818%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='3']{width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='3']{left:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='3']{min-width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='3']{max-width:27.2727272727%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='4']{width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='4']{left:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='4']{min-width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='4']{max-width:36.3636363636%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='5']{width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='5']{left:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='5']{min-width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='5']{max-width:45.4545454545%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='6']{width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='6']{left:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='6']{min-width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='6']{max-width:54.5454545455%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='7']{width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='7']{left:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='7']{min-width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='7']{max-width:63.6363636364%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='8']{width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='8']{left:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='8']{min-width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='8']{max-width:72.7272727273%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='9']{width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='9']{left:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='9']{min-width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='9']{max-width:81.8181818182%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='10']{width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='10']{left:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='10']{min-width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='10']{max-width:90.9090909091%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-width='11']{width:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-x='11']{left:100%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-min-width='11']{min-width:100%}.grid-stack.grid-stack-12>.grid-stack-item,.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack.grid-stack-11>.grid-stack-item[data-gs-max-width='11']{max-width:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='1']{width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='3']{width:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='3']{left:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='3']{min-width:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='3']{max-width:25%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='4']{width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='6']{width:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='6']{left:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='6']{min-width:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='6']{max-width:50%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='7']{width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='9']{width:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='9']{left:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='9']{min-width:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='9']{max-width:75%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='10']{width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-width='12']{width:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-x='12']{left:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-min-width='12']{min-width:100%}.grid-stack.grid-stack-12>.grid-stack-item[data-gs-max-width='12']{max-width:100%} \ No newline at end of file diff --git a/dist/gridstack.all.js b/dist/gridstack.all.js deleted file mode 100644 index 3fa2f2b82..000000000 --- a/dist/gridstack.all.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(b){}try{_=require("lodash")}catch(b){}a(jQuery,_)}else a(jQuery,_)}(function(a,b){ -// jscs:enable requireCamelCaseOrUpperCaseIdentifiers -/** - * @class GridStackDragDropPlugin - * Base class for drag'n'drop plugin. - */ -function c(a){this.grid=a}var d=window,e=function(a,b,c){var d=function(){return console.warn("gridstack.js: Function `"+b+"` is deprecated as of v0.2.5 and has been replaced with `"+c+"`. It will be **completely** removed in v1.0."),a.apply(this,arguments)};return d.prototype=a.prototype,d},f=function(a,b){console.warn("gridstack.js: Option `"+a+"` is deprecated as of v0.2.5 and has been replaced with `"+b+"`. It will be **completely** removed in v1.0.")},g={isIntercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(a,c,d){return d=d||b.chain(a).map(function(a){return a.x+a.width}).max().value(),c=-1!=c?1:-1,b.sortBy(a,function(a){return c*(a.x+a.y*d)})},createStylesheet:function(a){var b=document.createElement("style");return b.setAttribute("type","text/css"),b.setAttribute("data-gs-style-id",a),b.styleSheet?b.styleSheet.cssText="":b.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(b),b.sheet},removeStylesheet:function(b){a("STYLE[data-gs-style-id="+b+"]").remove()},insertCSSRule:function(a,b,c,d){"function"==typeof a.insertRule?a.insertRule(b+"{"+c+"}",d):"function"==typeof a.addRule&&a.addRule(b,c,d)},toBool:function(a){return"boolean"==typeof a?a:"string"==typeof a?(a=a.toLowerCase(),!(""===a||"no"==a||"false"==a||"0"==a)):Boolean(a)},_collisionNodeCheck:function(a){return a!=this.node&&g.isIntercepted(a,this.nn)},_didCollide:function(a){return g.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_isAddNodeIntercepted:function(a){return g.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},a)},parseHeight:function(a){var c=a,d="px";if(c&&b.isString(c)){var e=c.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!e)throw new Error("Invalid height");d=e[2]||"px",c=parseFloat(e[1])}return{height:c,unit:d}},removePositioningStyles:function(a){var b=a[0].style;b.position&&b.removeProperty("position"),b.left&&b.removeProperty("left"),b.top&&b.removeProperty("top"),b.width&&b.removeProperty("width"),b.height&&b.removeProperty("height")}}; -// jscs:disable requireCamelCaseOrUpperCaseIdentifiers -g.is_intercepted=e(g.isIntercepted,"is_intercepted","isIntercepted"),g.create_stylesheet=e(g.createStylesheet,"create_stylesheet","createStylesheet"),g.remove_stylesheet=e(g.removeStylesheet,"remove_stylesheet","removeStylesheet"),g.insert_css_rule=e(g.insertCSSRule,"insert_css_rule","insertCSSRule"),c.registeredPlugins=[],c.registerPlugin=function(a){c.registeredPlugins.push(a)},c.prototype.resizable=function(a,b){return this},c.prototype.draggable=function(a,b){return this},c.prototype.droppable=function(a,b){return this},c.prototype.isDroppable=function(a){return!1},c.prototype.on=function(a,b,c){return this};var h=0,i=function(a,b,c,d,e){this.width=a,this["float"]=c||!1,this.height=d||0,this.nodes=e||[],this.onchange=b||function(){},this._updateCounter=0,this._float=this["float"],this._addedNodes=[],this._removedNodes=[]};i.prototype.batchUpdate=function(){this._updateCounter=1,this["float"]=!0},i.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this["float"]=this._float,this._packNodes(),this._notify())}, -// For Meteor support: https://github.com/troolee/gridstack.js/pull/272 -i.prototype.getNodeDataByDOMEl=function(a){return b.find(this.nodes,function(b){return a.get(0)===b.el.get(0)})},i.prototype._fixCollisions=function(a){this._sortNodes(-1);var c=a,d=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||d||(c={x:0,y:a.y,width:this.width,height:a.height});;){var e=b.find(this.nodes,b.bind(g._collisionNodeCheck,{node:a,nn:c}));if("undefined"==typeof e)return;this.moveNode(e,e.x,a.y+a.height,e.width,e.height,!0)}},i.prototype.isAreaEmpty=function(a,c,d,e){var f={x:a||0,y:c||0,width:d||1,height:e||1},h=b.find(this.nodes,b.bind(function(a){return g.isIntercepted(a,f)},this));return null===h||"undefined"==typeof h},i.prototype._sortNodes=function(a){this.nodes=g.sort(this.nodes,a,this.width)},i.prototype._packNodes=function(){this._sortNodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._origY&&a.y!=a._origY)for(var d=a.y;d>=a._origY;){var e=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e||(a._dirty=!0,a.y=d),--d}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var d=a.y-1,e=0===c;if(c>0){var f=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e="undefined"==typeof f}if(!e)break;a._dirty=a.y!=d,a.y=d}},this))},i.prototype._prepareNode=function(a,c){return a=b.defaults(a||{},{width:1,height:1,x:0,y:0}),a.x=parseInt(""+a.x),a.y=parseInt(""+a.y),a.width=parseInt(""+a.width),a.height=parseInt(""+a.height),a.autoPosition=a.autoPosition||!1,a.noResize=a.noResize||!1,a.noMove=a.noMove||!1,a.width>this.width?a.width=this.width:a.width<1&&(a.width=1),a.height<1&&(a.height=1),a.x<0&&(a.x=0),a.x+a.width>this.width&&(c?a.width=this.width-a.x:a.x=this.width-a.width),a.y<0&&(a.y=0),a},i.prototype._notify=function(){var a=Array.prototype.slice.call(arguments,0);if(a[0]="undefined"==typeof a[0]?[]:[a[0]],a[1]="undefined"==typeof a[1]?!0:a[1],!this._updateCounter){var b=a[0].concat(this.getDirtyNodes());this.onchange(b,a[1])}},i.prototype.cleanNodes=function(){this._updateCounter||b.each(this.nodes,function(a){a._dirty=!1})},i.prototype.getDirtyNodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},i.prototype.addNode=function(a,c){if(a=this._prepareNode(a),"undefined"!=typeof a.maxWidth&&(a.width=Math.min(a.width,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(a.height=Math.min(a.height,a.maxHeight)),"undefined"!=typeof a.minWidth&&(a.width=Math.max(a.width,a.minWidth)),"undefined"!=typeof a.minHeight&&(a.height=Math.max(a.height,a.minHeight)),a._id=++h,a._dirty=!0,a.autoPosition){this._sortNodes();for(var d=0;;++d){var e=d%this.width,f=Math.floor(d/this.width);if(!(e+a.width>this.width||b.find(this.nodes,b.bind(g._isAddNodeIntercepted,{x:e,y:f,node:a})))){a.x=e,a.y=f;break}}}return this.nodes.push(a),"undefined"!=typeof c&&c&&this._addedNodes.push(b.clone(a)),this._fixCollisions(a),this._packNodes(),this._notify(),a},i.prototype.removeNode=function(a,c){c="undefined"==typeof c?!0:c,this._removedNodes.push(b.clone(a)),a._id=null,this.nodes=b.without(this.nodes,a),this._packNodes(),this._notify(a,c)},i.prototype.canMoveNode=function(c,d,e,f,g){if(!this.isNodeChangedPosition(c,d,e,f,g))return!1;var h=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!h)return!0;var j,k=new i(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));if("undefined"==typeof j)return!0;k.moveNode(j,d,e,f,g);var l=!0;return h&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.getGridHeight()<=this.height),l},i.prototype.canBePlacedWithRespectToHeight=function(c){if(!this.height)return!0;var d=new i(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.addNode(c),d.getGridHeight()<=this.height},i.prototype.isNodeChangedPosition=function(a,b,c,d,e){return"number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),"undefined"!=typeof a.maxWidth&&(d=Math.min(d,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(e=Math.min(e,a.maxHeight)),"undefined"!=typeof a.minWidth&&(d=Math.max(d,a.minWidth)),"undefined"!=typeof a.minHeight&&(e=Math.max(e,a.minHeight)),a.x!=b||a.y!=c||a.width!=d||a.height!=e},i.prototype.moveNode=function(a,b,c,d,e,f){if(!this.isNodeChangedPosition(a,b,c,d,e))return a;if("number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),"undefined"!=typeof a.maxWidth&&(d=Math.min(d,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(e=Math.min(e,a.maxHeight)),"undefined"!=typeof a.minWidth&&(d=Math.max(d,a.minWidth)),"undefined"!=typeof a.minHeight&&(e=Math.max(e,a.minHeight)),a.x==b&&a.y==c&&a.width==d&&a.height==e)return a;var g=a.width!=d;return a._dirty=!0,a.x=b,a.y=c,a.width=d,a.height=e,a.lastTriedX=b,a.lastTriedY=c,a.lastTriedWidth=d,a.lastTriedHeight=e,a=this._prepareNode(a,g),this._fixCollisions(a),f||(this._packNodes(),this._notify()),a},i.prototype.getGridHeight=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},i.prototype.beginUpdate=function(a){b.each(this.nodes,function(a){a._origY=a.y}),a._updating=!0},i.prototype.endUpdate=function(){b.each(this.nodes,function(a){a._origY=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var j=function(d,e){var h,j,k=this;e=e||{},this.container=a(d),"undefined"!=typeof e.handle_class&&(e.handleClass=e.handle_class,f("handle_class","handleClass")),"undefined"!=typeof e.item_class&&(e.itemClass=e.item_class,f("item_class","itemClass")),"undefined"!=typeof e.placeholder_class&&(e.placeholderClass=e.placeholder_class,f("placeholder_class","placeholderClass")),"undefined"!=typeof e.placeholder_text&&(e.placeholderText=e.placeholder_text,f("placeholder_text","placeholderText")),"undefined"!=typeof e.cell_height&&(e.cellHeight=e.cell_height,f("cell_height","cellHeight")),"undefined"!=typeof e.vertical_margin&&(e.verticalMargin=e.vertical_margin,f("vertical_margin","verticalMargin")),"undefined"!=typeof e.min_width&&(e.minWidth=e.min_width,f("min_width","minWidth")),"undefined"!=typeof e.static_grid&&(e.staticGrid=e.static_grid,f("static_grid","staticGrid")),"undefined"!=typeof e.is_nested&&(e.isNested=e.is_nested,f("is_nested","isNested")),"undefined"!=typeof e.always_show_resize_handle&&(e.alwaysShowResizeHandle=e.always_show_resize_handle,f("always_show_resize_handle","alwaysShowResizeHandle")),e.itemClass=e.itemClass||"grid-stack-item";var l=this.container.closest("."+e.itemClass).length>0;if(this.opts=b.defaults(e||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,"float":!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:b.defaults(e.resizable||{},{autoHide:!e.alwaysShowResizeHandle,handles:"se"}),draggable:b.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:e.disableDrag||!1,disableResize:e.disableResize||!1,rtl:"auto",removable:!1,removableOptions:b.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||!1,oneColumnModeClass:e.oneColumnModeClass||"grid-stack-one-column-mode",ddPlugin:null}),this.opts.ddPlugin===!1?this.opts.ddPlugin=c:null===this.opts.ddPlugin&&(this.opts.ddPlugin=b.first(c.registeredPlugins)||c),this.dd=new this.opts.ddPlugin(this),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&&this.container.addClass("grid-stack-rtl"),this.opts.isNested=l,j="auto"===this.opts.cellHeight,j?k.cellHeight(k.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),l&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new i(this.opts.width,function(a,c){c="undefined"==typeof c?!0:c;var d=0;b.each(a,function(a){c&&null===a._id?a.el&&a.el.remove():(a.el.attr("data-gs-x",a.x).attr("data-gs-y",a.y).attr("data-gs-width",a.width).attr("data-gs-height",a.height),d=Math.max(d,a.y+a.height))}),k._updateStyles(d+10)},this.opts["float"],this.opts.height),this.opts.auto){var m=[],n=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(b,c){c=a(c),m.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*n.opts.width})}),b.chain(m).sortBy(function(a){return a.i}).each(function(a){k._prepareElement(a.el)}).value()}if(this.setAnimation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholderText+"
").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=b.throttle(function(){k.cellHeight(k.cellWidth(),!1)},100),this.onResizeHandler=function(){if(j&&k._updateHeightsOnResize(),k._isOneColumnMode()&&!k.opts.disableOneColumnMode){if(h)return;k.container.addClass(k.opts.oneColumnModeClass),h=!0,k.grid._sortNodes(),b.each(k.grid.nodes,function(a){k.container.append(a.el),k.opts.staticGrid||(k.dd.draggable(a.el,"disable"),k.dd.resizable(a.el,"disable"),a.el.trigger("resize"))})}else{if(!h)return;if(k.container.removeClass(k.opts.oneColumnModeClass),h=!1,k.opts.staticGrid)return;b.each(k.grid.nodes,function(a){a.noMove||k.opts.disableDrag||k.dd.draggable(a.el,"enable"),a.noResize||k.opts.disableResize||k.dd.resizable(a.el,"enable"),a.el.trigger("resize")})}},a(window).resize(this.onResizeHandler),this.onResizeHandler(),!k.opts.staticGrid&&"string"==typeof k.opts.removable){var o=a(k.opts.removable);this.dd.isDroppable(o)||this.dd.droppable(o,k.opts.removableOptions),this.dd.on(o,"dropover",function(b,c){var d=a(c.draggable),e=d.data("_gridstack_node");e._grid===k&&(d.data("inTrashZone",!0),k._setupRemovingTimeout(d))}).on(o,"dropout",function(b,c){var d=a(c.draggable),e=d.data("_gridstack_node");e._grid===k&&(d.data("inTrashZone",!1),k._clearRemovingTimeout(d))})}if(!k.opts.staticGrid&&k.opts.acceptWidgets){var p=null,q=function(a,b){var c=p,d=c.data("_gridstack_node"),e=k.getCellFromPixel({left:a.pageX,top:a.pageY},!0),f=Math.max(0,e.x),g=Math.max(0,e.y);d._added||(d._added=!0,d.el=c,d.autoPosition=!0,d.x=f,d.y=g,k.grid.cleanNodes(),k.grid.beginUpdate(d),k.grid.addNode(d),k.container.append(k.placeholder),k.placeholder.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).show(),d.el=k.placeholder,d._beforeDragX=d.x,d._beforeDragY=d.y,k._updateContainerHeight()),k.grid.canMoveNode(d,f,g)&&(k.grid.moveNode(d,f,g),k._updateContainerHeight())};this.dd.droppable(k.container,{accept:function(b){b=a(b);var c=b.data("_gridstack_node");return c&&c._grid===k?!1:b.is(k.opts.acceptWidgets===!0?".grid-stack-item":k.opts.acceptWidgets)}}).on(k.container,"dropover",function(b,c){var d=(k.container.offset(),a(c.draggable)),e=k.cellWidth(),f=k.cellHeight(),g=d.data("_gridstack_node"),h=g?g.width:Math.ceil(d.outerWidth()/e),i=g?g.height:Math.ceil(d.outerHeight()/f);p=d;var j=k.grid._prepareNode({width:h,height:i,_added:!1,_temporary:!0});d.data("_gridstack_node",j),d.data("_gridstack_node_orig",g),d.on("drag",q)}).on(k.container,"dropout",function(b,c){var d=a(c.draggable);if(d.data("_gridstack_node")){d.unbind("drag",q);var e=d.data("_gridstack_node");e.el=null,k.grid.removeNode(e),k.placeholder.detach(),k._updateContainerHeight(),d.data("_gridstack_node",d.data("_gridstack_node_orig"))}}).on(k.container,"drop",function(b,c){k.placeholder.detach();var d=a(c.draggable).data("_gridstack_node");d._grid=k;var e=a(c.draggable).clone(!1);e.data("_gridstack_node",d);var f=a(c.draggable).data("_gridstack_node_orig");"undefined"!=typeof f&&"undefined"!=typeof f._grid&&f._grid._triggerRemoveEvent(),a(c.helper).remove(),d.el=e,k.placeholder.hide(),g.removePositioningStyles(e),e.find("div.ui-resizable-handle").remove(),e.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).addClass(k.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",q),k.container.append(e),k._prepareElementsByNode(e,d),k._updateContainerHeight(),k.grid._addedNodes.push(d),k._triggerAddEvent(),k._triggerChangeEvent(),k.grid.endUpdate(),a(c.draggable).unbind("drag",q),a(c.draggable).removeData("_gridstack_node"),a(c.draggable).removeData("_gridstack_node_orig")})}}; -// jscs:disable requireCamelCaseOrUpperCaseIdentifiers -// jscs:enable requireCamelCaseOrUpperCaseIdentifiers -return j.prototype._triggerChangeEvent=function(a){var b=this.grid.getDirtyNodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},j.prototype._triggerAddEvent=function(){this.grid._addedNodes&&this.grid._addedNodes.length>0&&(this.container.trigger("added",[b.map(this.grid._addedNodes,b.clone)]),this.grid._addedNodes=[])},j.prototype._triggerRemoveEvent=function(){this.grid._removedNodes&&this.grid._removedNodes.length>0&&(this.container.trigger("removed",[b.map(this.grid._removedNodes,b.clone)]),this.grid._removedNodes=[])},j.prototype._initStyles=function(){this._stylesId&&g.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=g.createStylesheet(this._stylesId),null!==this._styles&&(this._styles._max=0)},j.prototype._updateStyles=function(a){if(null!==this._styles&&"undefined"!=typeof this._styles){var b,c="."+this.opts._class+" ."+this.opts.itemClass,d=this;if("undefined"==typeof a&&(a=this._styles._max),!(0!==this._styles._max&&a<=this._styles._max)&&(this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&(b=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(a,b){return a&&b?"calc("+(d.opts.cellHeight*a+d.opts.cellHeightUnit)+" + "+(d.opts.verticalMargin*b+d.opts.verticalMarginUnit)+")":d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit}:function(a,b){return d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit},0===this._styles._max&&g.insertCSSRule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max))){for(var e=this._styles._max;a>e;++e)g.insertCSSRule(this._styles,c+'[data-gs-height="'+(e+1)+'"]',"height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-min-height="'+(e+1)+'"]',"min-height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-max-height="'+(e+1)+'"]',"max-height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-y="'+e+'"]',"top: "+b(e,e)+";",e);this._styles._max=a}}},j.prototype._updateContainerHeight=function(){if(!this.grid._updateCounter){var a=this.grid.getGridHeight(),b=parseInt(this.container.css("min-height"))/this.cellHeight();b>a&&(a=b),this.container.attr("data-gs-current-height",a),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.container.css("height",a*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.container.css("height","calc("+(a*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(a*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.container.css("height",a*this.opts.cellHeight+this.opts.cellHeightUnit))}},j.prototype._isOneColumnMode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.minWidth},j.prototype._setupRemovingTimeout=function(b){var c=this,d=a(b).data("_gridstack_node");!d._removeTimeout&&c.opts.removable&&(d._removeTimeout=setTimeout(function(){b.addClass("grid-stack-item-removing"),d._isAboutToRemove=!0},c.opts.removeTimeout))},j.prototype._clearRemovingTimeout=function(b){var c=a(b).data("_gridstack_node");c._removeTimeout&&(clearTimeout(c._removeTimeout),c._removeTimeout=null,b.removeClass("grid-stack-item-removing"),c._isAboutToRemove=!1)},j.prototype._prepareElementsByNode=function(b,c){var d,e,f=this,h=function(a,g){var h,i,j=Math.round(g.position.left/d),k=Math.floor((g.position.top+e/2)/e);if("drag"!=a.type&&(h=Math.round(g.size.width/d),i=Math.round(g.size.height/e)),"drag"==a.type)b.data("inTrashZone")||0>j||j>=f.grid.width||0>k||!f.grid["float"]&&k>f.grid.getGridHeight()?c._temporaryRemoved||(f.opts.removable===!0&&f._setupRemovingTimeout(b),j=c._beforeDragX,k=c._beforeDragY,f.placeholder.detach(),f.placeholder.hide(),f.grid.removeNode(c),f._updateContainerHeight(),c._temporaryRemoved=!0):(f._clearRemovingTimeout(b),c._temporaryRemoved&&(f.grid.addNode(c),f.placeholder.attr("data-gs-x",j).attr("data-gs-y",k).attr("data-gs-width",h).attr("data-gs-height",i).show(),f.container.append(f.placeholder),c.el=f.placeholder,c._temporaryRemoved=!1));else if("resize"==a.type&&0>j)return; -// width and height are undefined if not resizing -var l="undefined"!=typeof h?h:c.lastTriedWidth,m="undefined"!=typeof i?i:c.lastTriedHeight;!f.grid.canMoveNode(c,j,k,h,i)||c.lastTriedX===j&&c.lastTriedY===k&&c.lastTriedWidth===l&&c.lastTriedHeight===m||(c.lastTriedX=j,c.lastTriedY=k,c.lastTriedWidth=h,c.lastTriedHeight=i,f.grid.moveNode(c,j,k,h,i),f._updateContainerHeight())},i=function(g,h){f.container.append(f.placeholder);var i=a(this);f.grid.cleanNodes(),f.grid.beginUpdate(c),d=f.cellWidth();var j=Math.ceil(i.outerHeight()/i.attr("data-gs-height"));e=f.container.height()/parseInt(f.container.attr("data-gs-current-height")),f.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),c.el=f.placeholder,c._beforeDragX=c.x,c._beforeDragY=c.y,f.dd.resizable(b,"option","minWidth",d*(c.minWidth||1)),f.dd.resizable(b,"option","minHeight",j*(c.minHeight||1)),"resizestart"==g.type&&i.find(".grid-stack-item").trigger("resizestart")},j=function(d,e){var h=a(this);if(h.data("_gridstack_node")){var i=!1;if(f.placeholder.detach(),c.el=h,f.placeholder.hide(),c._isAboutToRemove){i=!0;var j=b.data("_gridstack_node")._grid;j._triggerRemoveEvent(),b.removeData("_gridstack_node"),b.remove()}else f._clearRemovingTimeout(b),c._temporaryRemoved?(g.removePositioningStyles(h),h.attr("data-gs-x",c._beforeDragX).attr("data-gs-y",c._beforeDragY).attr("data-gs-width",c.width).attr("data-gs-height",c.height),c.x=c._beforeDragX,c.y=c._beforeDragY,f.grid.addNode(c)):(g.removePositioningStyles(h),h.attr("data-gs-x",c.x).attr("data-gs-y",c.y).attr("data-gs-width",c.width).attr("data-gs-height",c.height));f._updateContainerHeight(),f._triggerChangeEvent(i),f.grid.endUpdate();var k=h.find(".grid-stack");k.length&&"resizestop"==d.type&&(k.each(function(b,c){a(c).data("gridstack").onResizeHandler()}),h.find(".grid-stack-item").trigger("resizestop"),h.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"==d.type&&f.container.trigger("gsresizestop",h)}};this.dd.draggable(b,{start:i,stop:j,drag:h}).resizable(b,{start:i,stop:j,resize:h}),(c.noMove||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(b,"disable"),(c.noResize||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(b,"disable"),b.attr("data-gs-locked",c.locked?"yes":null)},j.prototype._prepareElement=function(b,c){c="undefined"!=typeof c?c:!1;var d=this;b=a(b),b.addClass(this.opts.itemClass);var e=d.grid.addNode({x:b.attr("data-gs-x"),y:b.attr("data-gs-y"),width:b.attr("data-gs-width"),height:b.attr("data-gs-height"),maxWidth:b.attr("data-gs-max-width"),minWidth:b.attr("data-gs-min-width"),maxHeight:b.attr("data-gs-max-height"),minHeight:b.attr("data-gs-min-height"),autoPosition:g.toBool(b.attr("data-gs-auto-position")),noResize:g.toBool(b.attr("data-gs-no-resize")),noMove:g.toBool(b.attr("data-gs-no-move")),locked:g.toBool(b.attr("data-gs-locked")),resizeHandles:b.attr("data-gs-resize-handles"),el:b,id:b.attr("data-gs-id"),_grid:d},c);b.data("_gridstack_node",e),this._prepareElementsByNode(b,e)},j.prototype.setAnimation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},j.prototype.addWidget=function(b,c,d,e,f,g,h,i,j,k,l){return b=a(b),"undefined"!=typeof c&&b.attr("data-gs-x",c),"undefined"!=typeof d&&b.attr("data-gs-y",d),"undefined"!=typeof e&&b.attr("data-gs-width",e),"undefined"!=typeof f&&b.attr("data-gs-height",f),"undefined"!=typeof g&&b.attr("data-gs-auto-position",g?"yes":null),"undefined"!=typeof h&&b.attr("data-gs-min-width",h),"undefined"!=typeof i&&b.attr("data-gs-max-width",i),"undefined"!=typeof j&&b.attr("data-gs-min-height",j),"undefined"!=typeof k&&b.attr("data-gs-max-height",k),"undefined"!=typeof l&&b.attr("data-gs-id",l),this.container.append(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.makeWidget=function(b){return b=a(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.willItFit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,autoPosition:e};return this.grid.canBePlacedWithRespectToHeight(f)},j.prototype.removeWidget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node"); -// For Meteor support: https://github.com/troolee/gridstack.js/pull/272 -d||(d=this.grid.getNodeDataByDOMEl(b)),this.grid.removeNode(d,c),b.removeData("_gridstack_node"),this._updateContainerHeight(),c&&b.remove(),this._triggerChangeEvent(!0),this._triggerRemoveEvent()},j.prototype.removeAll=function(a){b.each(this.grid.nodes,b.bind(function(b){this.removeWidget(b.el,a)},this)),this.grid.nodes=[],this._updateContainerHeight()},j.prototype.destroy=function(b){a(window).off("resize",this.onResizeHandler),this.disable(),"undefined"==typeof b||b?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),g.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},j.prototype.resizable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");"undefined"!=typeof f&&null!==f&&(f.noResize=!c,f.noResize||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?d.dd.resizable(e,"disable"):d.dd.resizable(e,"enable"))}),this},j.prototype.movable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");"undefined"!=typeof f&&null!==f&&(f.noMove=!c,f.noMove||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?(d.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(d.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},j.prototype.enableMove=function(a,b){this.movable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableDrag=!a)},j.prototype.enableResize=function(a,b){this.resizable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableResize=!a)},j.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},j.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},j.prototype.locked=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(e.locked=c||!1,d.attr("data-gs-locked",e.locked?"yes":null))}),this},j.prototype.maxHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.maxHeight=c||!1,d.attr("data-gs-max-height",c)))}),this},j.prototype.minHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.minHeight=c||!1,d.attr("data-gs-min-height",c)))}),this},j.prototype.maxWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.maxWidth=c||!1,d.attr("data-gs-max-width",c)))}),this},j.prototype.minWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.minWidth=c||!1,d.attr("data-gs-min-width",c)))}),this},j.prototype._updateElement=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!==d){var e=this;e.grid.cleanNodes(),e.grid.beginUpdate(d),c.call(this,b,d),e._updateContainerHeight(),e._triggerChangeEvent(),e.grid.endUpdate()}},j.prototype.resize=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.width,c=null!==c&&"undefined"!=typeof c?c:d.height,this.grid.moveNode(d,d.x,d.y,b,c)})},j.prototype.move=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.x,c=null!==c&&"undefined"!=typeof c?c:d.y,this.grid.moveNode(d,b,c,d.width,d.height)})},j.prototype.update=function(a,b,c,d,e){this._updateElement(a,function(a,f){b=null!==b&&"undefined"!=typeof b?b:f.x,c=null!==c&&"undefined"!=typeof c?c:f.y,d=null!==d&&"undefined"!=typeof d?d:f.width,e=null!==e&&"undefined"!=typeof e?e:f.height,this.grid.moveNode(f,b,c,d,e)})},j.prototype.verticalMargin=function(a,b){if("undefined"==typeof a)return this.opts.verticalMargin;var c=g.parseHeight(a);this.opts.verticalMarginUnit===c.unit&&this.opts.height===c.height||(this.opts.verticalMarginUnit=c.unit,this.opts.verticalMargin=c.height,b||this._updateStyles())},j.prototype.cellHeight=function(a,b){if("undefined"==typeof a){if(this.opts.cellHeight)return this.opts.cellHeight;var c=this.container.children("."+this.opts.itemClass).first();return Math.ceil(c.outerHeight()/c.attr("data-gs-height"))}var d=g.parseHeight(a);this.opts.cellHeightUnit===d.heightUnit&&this.opts.height===d.height||(this.opts.cellHeightUnit=d.unit,this.opts.cellHeight=d.height,b||this._updateStyles())},j.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.width)},j.prototype.getCellFromPixel=function(a,b){var c="undefined"!=typeof b&&b?this.container.offset():this.container.position(),d=a.left-c.left,e=a.top-c.top,f=Math.floor(this.container.width()/this.opts.width),g=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(d/f),y:Math.floor(e/g)}},j.prototype.batchUpdate=function(){this.grid.batchUpdate()},j.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},j.prototype.isAreaEmpty=function(a,b,c,d){return this.grid.isAreaEmpty(a,b,c,d)},j.prototype.setStatic=function(a){this.opts.staticGrid=a===!0,this.enableMove(!a),this.enableResize(!a),this._setStaticClass()},j.prototype._setStaticClass=function(){var a="grid-stack-static";this.opts.staticGrid===!0?this.container.addClass(a):this.container.removeClass(a)},j.prototype._updateNodeWidths=function(a,b){this.grid._sortNodes(),this.grid.batchUpdate();for(var c={},d=0;d .ui-resizable-handle { - filter: none; -} - -.grid-stack { - position: relative; -} - -.grid-stack.grid-stack-rtl { - direction: ltr; -} - -.grid-stack.grid-stack-rtl > .grid-stack-item { - direction: rtl; -} - -.grid-stack .grid-stack-placeholder > .placeholder-content { - border: 1px dashed lightgray; - margin: 0; - position: absolute; - top: 0; - left: 10px; - right: 10px; - bottom: 0; - width: auto; - z-index: 0 !important; - text-align: center; -} - -.grid-stack > .grid-stack-item { - min-width: 8.3333333333%; - position: absolute; - padding: 0; -} - -.grid-stack > .grid-stack-item > .grid-stack-item-content { - margin: 0; - position: absolute; - top: 0; - left: 10px; - right: 10px; - bottom: 0; - width: auto; - z-index: 0 !important; - overflow-x: hidden; - overflow-y: auto; -} - -.grid-stack > .grid-stack-item > .ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - -ms-touch-action: none; - touch-action: none; -} - -.grid-stack > .grid-stack-item.ui-resizable-disabled > .ui-resizable-handle, -.grid-stack > .grid-stack-item.ui-resizable-autohide > .ui-resizable-handle { - display: none; -} - -.grid-stack > .grid-stack-item.ui-draggable-dragging, .grid-stack > .grid-stack-item.ui-resizable-resizing { - z-index: 100; -} - -.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content, -.grid-stack > .grid-stack-item.ui-draggable-dragging > .grid-stack-item-content, .grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content, -.grid-stack > .grid-stack-item.ui-resizable-resizing > .grid-stack-item-content { - box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2); - opacity: 0.8; -} - -.grid-stack > .grid-stack-item > .ui-resizable-se, -.grid-stack > .grid-stack-item > .ui-resizable-sw { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K); - background-repeat: no-repeat; - background-position: center; - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} - -.grid-stack > .grid-stack-item > .ui-resizable-se { - -webkit-transform: rotate(-45deg); - -moz-transform: rotate(-45deg); - -ms-transform: rotate(-45deg); - -o-transform: rotate(-45deg); - transform: rotate(-45deg); -} - -.grid-stack > .grid-stack-item > .ui-resizable-nw { - cursor: nw-resize; - width: 20px; - height: 20px; - left: 10px; - top: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-n { - cursor: n-resize; - height: 10px; - top: 0; - left: 25px; - right: 25px; -} - -.grid-stack > .grid-stack-item > .ui-resizable-ne { - cursor: ne-resize; - width: 20px; - height: 20px; - right: 10px; - top: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-e { - cursor: e-resize; - width: 10px; - right: 10px; - top: 15px; - bottom: 15px; -} - -.grid-stack > .grid-stack-item > .ui-resizable-se { - cursor: se-resize; - width: 20px; - height: 20px; - right: 10px; - bottom: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-s { - cursor: s-resize; - height: 10px; - left: 25px; - bottom: 0; - right: 25px; -} - -.grid-stack > .grid-stack-item > .ui-resizable-sw { - cursor: sw-resize; - width: 20px; - height: 20px; - left: 10px; - bottom: 0; -} - -.grid-stack > .grid-stack-item > .ui-resizable-w { - cursor: w-resize; - width: 10px; - left: 10px; - top: 15px; - bottom: 15px; -} - -.grid-stack > .grid-stack-item.ui-draggable-dragging > .ui-resizable-handle { - display: none !important; -} - -.grid-stack > .grid-stack-item[data-gs-width='1'] { - width: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='1'] { - left: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='1'] { - min-width: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='1'] { - max-width: 8.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='2'] { - width: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='2'] { - left: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='2'] { - min-width: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='2'] { - max-width: 16.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='3'] { - width: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-x='3'] { - left: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='3'] { - min-width: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='3'] { - max-width: 25%; -} - -.grid-stack > .grid-stack-item[data-gs-width='4'] { - width: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='4'] { - left: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='4'] { - min-width: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='4'] { - max-width: 33.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='5'] { - width: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='5'] { - left: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='5'] { - min-width: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='5'] { - max-width: 41.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='6'] { - width: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-x='6'] { - left: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='6'] { - min-width: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='6'] { - max-width: 50%; -} - -.grid-stack > .grid-stack-item[data-gs-width='7'] { - width: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='7'] { - left: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='7'] { - min-width: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='7'] { - max-width: 58.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='8'] { - width: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='8'] { - left: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='8'] { - min-width: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='8'] { - max-width: 66.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='9'] { - width: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-x='9'] { - left: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='9'] { - min-width: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='9'] { - max-width: 75%; -} - -.grid-stack > .grid-stack-item[data-gs-width='10'] { - width: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-x='10'] { - left: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='10'] { - min-width: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='10'] { - max-width: 83.3333333333%; -} - -.grid-stack > .grid-stack-item[data-gs-width='11'] { - width: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-x='11'] { - left: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='11'] { - min-width: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='11'] { - max-width: 91.6666666667%; -} - -.grid-stack > .grid-stack-item[data-gs-width='12'] { - width: 100%; -} - -.grid-stack > .grid-stack-item[data-gs-x='12'] { - left: 100%; -} - -.grid-stack > .grid-stack-item[data-gs-min-width='12'] { - min-width: 100%; -} - -.grid-stack > .grid-stack-item[data-gs-max-width='12'] { - max-width: 100%; -} - -.grid-stack.grid-stack-animate, -.grid-stack.grid-stack-animate .grid-stack-item { - -webkit-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - -moz-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - -ms-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - -o-transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; - transition: left 0.3s, top 0.3s, height 0.3s, width 0.3s; -} - -.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging, -.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing, -.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder { - -webkit-transition: left 0s, top 0s, height 0s, width 0s; - -moz-transition: left 0s, top 0s, height 0s, width 0s; - -ms-transition: left 0s, top 0s, height 0s, width 0s; - -o-transition: left 0s, top 0s, height 0s, width 0s; - transition: left 0s, top 0s, height 0s, width 0s; -} - -.grid-stack.grid-stack-one-column-mode { - height: auto !important; -} - -.grid-stack.grid-stack-one-column-mode > .grid-stack-item { - position: relative !important; - width: auto !important; - left: 0 !important; - top: auto !important; - margin-bottom: 20px; - max-width: none !important; -} - -.grid-stack.grid-stack-one-column-mode > .grid-stack-item > .ui-resizable-handle { - display: none; -} diff --git a/dist/gridstack.jQueryUI.js b/dist/gridstack.jQueryUI.js deleted file mode 100644 index 1cae78d09..000000000 --- a/dist/gridstack.jQueryUI.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -(function(factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery', 'lodash', 'gridstack', 'jquery-ui/data', 'jquery-ui/disable-selection', 'jquery-ui/focusable', - 'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels', 'jquery-ui/jquery-1-7', - 'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur', 'jquery-ui/scroll-parent', - 'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version', 'jquery-ui/widget', - 'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable', 'jquery-ui/widgets/droppable', - 'jquery-ui/widgets/resizable'], factory); - } else if (typeof exports !== 'undefined') { - try { jQuery = require('jquery'); } catch (e) {} - try { _ = require('lodash'); } catch (e) {} - try { GridStackUI = require('gridstack'); } catch (e) {} - factory(jQuery, _, GridStackUI); - } else { - factory(jQuery, _, GridStackUI); - } -})(function($, _, GridStackUI) { - - var scope = window; - - /** - * @class JQueryUIGridStackDragDropPlugin - * jQuery UI implementation of drag'n'drop gridstack plugin. - */ - function JQueryUIGridStackDragDropPlugin(grid) { - GridStackUI.GridStackDragDropPlugin.call(this, grid); - } - - GridStackUI.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin); - - JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStackUI.GridStackDragDropPlugin.prototype); - JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin; - - JQueryUIGridStackDragDropPlugin.prototype.resizable = function(el, opts) { - el = $(el); - if (opts === 'disable' || opts === 'enable') { - el.resizable(opts); - } else if (opts === 'option') { - var key = arguments[2]; - var value = arguments[3]; - el.resizable(opts, key, value); - } else { - var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') : - this.grid.opts.resizable.handles; - el.resizable(_.extend({}, this.grid.opts.resizable, { - handles: handles - }, { - start: opts.start || function() {}, - stop: opts.stop || function() {}, - resize: opts.resize || function() {} - })); - } - return this; - }; - - JQueryUIGridStackDragDropPlugin.prototype.draggable = function(el, opts) { - el = $(el); - if (opts === 'disable' || opts === 'enable') { - el.draggable(opts); - } else { - el.draggable(_.extend({}, this.grid.opts.draggable, { - containment: this.grid.opts.isNested ? this.grid.container.parent() : null, - start: opts.start || function() {}, - stop: opts.stop || function() {}, - drag: opts.drag || function() {} - })); - } - return this; - }; - - JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) { - el = $(el); - el.droppable(opts); - return this; - }; - - JQueryUIGridStackDragDropPlugin.prototype.isDroppable = function(el, opts) { - el = $(el); - return Boolean(el.data('droppable')); - }; - - JQueryUIGridStackDragDropPlugin.prototype.on = function(el, eventName, callback) { - $(el).on(eventName, callback); - return this; - }; - - return JQueryUIGridStackDragDropPlugin; -}); diff --git a/dist/gridstack.jQueryUI.min.js b/dist/gridstack.jQueryUI.min.js deleted file mode 100644 index e6d6ce106..000000000 --- a/dist/gridstack.jQueryUI.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","gridstack","jquery-ui/data","jquery-ui/disable-selection","jquery-ui/focusable","jquery-ui/form","jquery-ui/ie","jquery-ui/keycode","jquery-ui/labels","jquery-ui/jquery-1-7","jquery-ui/plugin","jquery-ui/safe-active-element","jquery-ui/safe-blur","jquery-ui/scroll-parent","jquery-ui/tabbable","jquery-ui/unique-id","jquery-ui/version","jquery-ui/widget","jquery-ui/widgets/mouse","jquery-ui/widgets/draggable","jquery-ui/widgets/droppable","jquery-ui/widgets/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(b){}try{_=require("lodash")}catch(b){}try{GridStackUI=require("gridstack")}catch(b){}a(jQuery,_,GridStackUI)}else a(jQuery,_,GridStackUI)}(function(a,b,c){/** - * @class JQueryUIGridStackDragDropPlugin - * jQuery UI implementation of drag'n'drop gridstack plugin. - */ -function d(a){c.GridStackDragDropPlugin.call(this,a)}window;return c.GridStackDragDropPlugin.registerPlugin(d),d.prototype=Object.create(c.GridStackDragDropPlugin.prototype),d.prototype.constructor=d,d.prototype.resizable=function(c,d){if(c=a(c),"disable"===d||"enable"===d)c.resizable(d);else if("option"===d){var e=arguments[2],f=arguments[3];c.resizable(d,e,f)}else{var g=c.data("gs-resize-handles")?c.data("gs-resize-handles"):this.grid.opts.resizable.handles;c.resizable(b.extend({},this.grid.opts.resizable,{handles:g},{start:d.start||function(){},stop:d.stop||function(){},resize:d.resize||function(){}}))}return this},d.prototype.draggable=function(c,d){return c=a(c),"disable"===d||"enable"===d?c.draggable(d):c.draggable(b.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested?this.grid.container.parent():null,start:d.start||function(){},stop:d.stop||function(){},drag:d.drag||function(){}})),this},d.prototype.droppable=function(b,c){return b=a(b),b.droppable(c),this},d.prototype.isDroppable=function(b,c){return b=a(b),Boolean(b.data("droppable"))},d.prototype.on=function(b,c,d){return a(b).on(c,d),this},d}); -//# sourceMappingURL=gridstack.min.map \ No newline at end of file diff --git a/dist/gridstack.js b/dist/gridstack.js deleted file mode 100644 index 71e2f9d45..000000000 --- a/dist/gridstack.js +++ /dev/null @@ -1,1785 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -(function(factory) { - if (typeof define === 'function' && define.amd) { - define(['jquery', 'lodash'], factory); - } else if (typeof exports !== 'undefined') { - try { jQuery = require('jquery'); } catch (e) {} - try { _ = require('lodash'); } catch (e) {} - factory(jQuery, _); - } else { - factory(jQuery, _); - } -})(function($, _) { - - var scope = window; - - var obsolete = function(f, oldName, newName) { - var wrapper = function() { - console.warn('gridstack.js: Function `' + oldName + '` is deprecated as of v0.2.5 and has been replaced ' + - 'with `' + newName + '`. It will be **completely** removed in v1.0.'); - return f.apply(this, arguments); - }; - wrapper.prototype = f.prototype; - - return wrapper; - }; - - var obsoleteOpts = function(oldName, newName) { - console.warn('gridstack.js: Option `' + oldName + '` is deprecated as of v0.2.5 and has been replaced with `' + - newName + '`. It will be **completely** removed in v1.0.'); - }; - - var Utils = { - isIntercepted: function(a, b) { - return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y); - }, - - sort: function(nodes, dir, width) { - width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value(); - dir = dir != -1 ? 1 : -1; - return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); }); - }, - - createStylesheet: function(id) { - var style = document.createElement('style'); - style.setAttribute('type', 'text/css'); - style.setAttribute('data-gs-style-id', id); - if (style.styleSheet) { - style.styleSheet.cssText = ''; - } else { - style.appendChild(document.createTextNode('')); - } - document.getElementsByTagName('head')[0].appendChild(style); - return style.sheet; - }, - - removeStylesheet: function(id) { - $('STYLE[data-gs-style-id=' + id + ']').remove(); - }, - - insertCSSRule: function(sheet, selector, rules, index) { - if (typeof sheet.insertRule === 'function') { - sheet.insertRule(selector + '{' + rules + '}', index); - } else if (typeof sheet.addRule === 'function') { - sheet.addRule(selector, rules, index); - } - }, - - toBool: function(v) { - if (typeof v == 'boolean') { - return v; - } - if (typeof v == 'string') { - v = v.toLowerCase(); - return !(v === '' || v == 'no' || v == 'false' || v == '0'); - } - return Boolean(v); - }, - - _collisionNodeCheck: function(n) { - return n != this.node && Utils.isIntercepted(n, this.nn); - }, - - _didCollide: function(bn) { - return Utils.isIntercepted({x: this.n.x, y: this.newY, width: this.n.width, height: this.n.height}, bn); - }, - - _isAddNodeIntercepted: function(n) { - return Utils.isIntercepted({x: this.x, y: this.y, width: this.node.width, height: this.node.height}, n); - }, - - parseHeight: function(val) { - var height = val; - var heightUnit = 'px'; - if (height && _.isString(height)) { - var match = height.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/); - if (!match) { - throw new Error('Invalid height'); - } - heightUnit = match[2] || 'px'; - height = parseFloat(match[1]); - } - return {height: height, unit: heightUnit}; - }, - - removePositioningStyles: function(el) { - var style = el[0].style; - if (style.position) { - style.removeProperty('position'); - } - if (style.left) { - style.removeProperty('left'); - } - if (style.top) { - style.removeProperty('top'); - } - if (style.width) { - style.removeProperty('width'); - } - if (style.height) { - style.removeProperty('height'); - } - } - }; - - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - Utils.is_intercepted = obsolete(Utils.isIntercepted, 'is_intercepted', 'isIntercepted'); - - Utils.create_stylesheet = obsolete(Utils.createStylesheet, 'create_stylesheet', 'createStylesheet'); - - Utils.remove_stylesheet = obsolete(Utils.removeStylesheet, 'remove_stylesheet', 'removeStylesheet'); - - Utils.insert_css_rule = obsolete(Utils.insertCSSRule, 'insert_css_rule', 'insertCSSRule'); - // jscs:enable requireCamelCaseOrUpperCaseIdentifiers - - /** - * @class GridStackDragDropPlugin - * Base class for drag'n'drop plugin. - */ - function GridStackDragDropPlugin(grid) { - this.grid = grid; - } - - GridStackDragDropPlugin.registeredPlugins = []; - - GridStackDragDropPlugin.registerPlugin = function(pluginClass) { - GridStackDragDropPlugin.registeredPlugins.push(pluginClass); - }; - - GridStackDragDropPlugin.prototype.resizable = function(el, opts) { - return this; - }; - - GridStackDragDropPlugin.prototype.draggable = function(el, opts) { - return this; - }; - - GridStackDragDropPlugin.prototype.droppable = function(el, opts) { - return this; - }; - - GridStackDragDropPlugin.prototype.isDroppable = function(el) { - return false; - }; - - GridStackDragDropPlugin.prototype.on = function(el, eventName, callback) { - return this; - }; - - - var idSeq = 0; - - var GridStackEngine = function(width, onchange, floatMode, height, items) { - this.width = width; - this.float = floatMode || false; - this.height = height || 0; - - this.nodes = items || []; - this.onchange = onchange || function() {}; - - this._updateCounter = 0; - this._float = this.float; - - this._addedNodes = []; - this._removedNodes = []; - }; - - GridStackEngine.prototype.batchUpdate = function() { - this._updateCounter = 1; - this.float = true; - }; - - GridStackEngine.prototype.commit = function() { - if (this._updateCounter !== 0) { - this._updateCounter = 0; - this.float = this._float; - this._packNodes(); - this._notify(); - } - }; - - // For Meteor support: https://github.com/troolee/gridstack.js/pull/272 - GridStackEngine.prototype.getNodeDataByDOMEl = function(el) { - return _.find(this.nodes, function(n) { return el.get(0) === n.el.get(0); }); - }; - - GridStackEngine.prototype._fixCollisions = function(node) { - var self = this; - this._sortNodes(-1); - - var nn = node; - var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); - if (!this.float && !hasLocked) { - nn = {x: 0, y: node.y, width: this.width, height: node.height}; - } - while (true) { - var collisionNode = _.find(this.nodes, _.bind(Utils._collisionNodeCheck, {node: node, nn: nn})); - if (typeof collisionNode == 'undefined') { - return; - } - this.moveNode(collisionNode, collisionNode.x, node.y + node.height, - collisionNode.width, collisionNode.height, true); - } - }; - - GridStackEngine.prototype.isAreaEmpty = function(x, y, width, height) { - var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; - var collisionNode = _.find(this.nodes, _.bind(function(n) { - return Utils.isIntercepted(n, nn); - }, this)); - return collisionNode === null || typeof collisionNode === 'undefined'; - }; - - GridStackEngine.prototype._sortNodes = function(dir) { - this.nodes = Utils.sort(this.nodes, dir, this.width); - }; - - GridStackEngine.prototype._packNodes = function() { - this._sortNodes(); - - if (this.float) { - _.each(this.nodes, _.bind(function(n, i) { - if (n._updating || typeof n._origY == 'undefined' || n.y == n._origY) { - return; - } - - var newY = n.y; - while (newY >= n._origY) { - var collisionNode = _.chain(this.nodes) - .take(i) - .find(_.bind(Utils._didCollide, {n: n, newY: newY})) - .value(); - - if (!collisionNode) { - n._dirty = true; - n.y = newY; - } - --newY; - } - }, this)); - } else { - _.each(this.nodes, _.bind(function(n, i) { - if (n.locked) { - return; - } - while (n.y > 0) { - var newY = n.y - 1; - var canBeMoved = i === 0; - - if (i > 0) { - var collisionNode = _.chain(this.nodes) - .take(i) - .find(_.bind(Utils._didCollide, {n: n, newY: newY})) - .value(); - canBeMoved = typeof collisionNode == 'undefined'; - } - - if (!canBeMoved) { - break; - } - n._dirty = n.y != newY; - n.y = newY; - } - }, this)); - } - }; - - GridStackEngine.prototype._prepareNode = function(node, resizing) { - node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0}); - - node.x = parseInt('' + node.x); - node.y = parseInt('' + node.y); - node.width = parseInt('' + node.width); - node.height = parseInt('' + node.height); - node.autoPosition = node.autoPosition || false; - node.noResize = node.noResize || false; - node.noMove = node.noMove || false; - - if (node.width > this.width) { - node.width = this.width; - } else if (node.width < 1) { - node.width = 1; - } - - if (node.height < 1) { - node.height = 1; - } - - if (node.x < 0) { - node.x = 0; - } - - if (node.x + node.width > this.width) { - if (resizing) { - node.width = this.width - node.x; - } else { - node.x = this.width - node.width; - } - } - - if (node.y < 0) { - node.y = 0; - } - - return node; - }; - - GridStackEngine.prototype._notify = function() { - var args = Array.prototype.slice.call(arguments, 0); - args[0] = typeof args[0] === 'undefined' ? [] : [args[0]]; - args[1] = typeof args[1] === 'undefined' ? true : args[1]; - if (this._updateCounter) { - return; - } - var deletedNodes = args[0].concat(this.getDirtyNodes()); - this.onchange(deletedNodes, args[1]); - }; - - GridStackEngine.prototype.cleanNodes = function() { - if (this._updateCounter) { - return; - } - _.each(this.nodes, function(n) {n._dirty = false; }); - }; - - GridStackEngine.prototype.getDirtyNodes = function() { - return _.filter(this.nodes, function(n) { return n._dirty; }); - }; - - GridStackEngine.prototype.addNode = function(node, triggerAddEvent) { - node = this._prepareNode(node); - - if (typeof node.maxWidth != 'undefined') { node.width = Math.min(node.width, node.maxWidth); } - if (typeof node.maxHeight != 'undefined') { node.height = Math.min(node.height, node.maxHeight); } - if (typeof node.minWidth != 'undefined') { node.width = Math.max(node.width, node.minWidth); } - if (typeof node.minHeight != 'undefined') { node.height = Math.max(node.height, node.minHeight); } - - node._id = ++idSeq; - node._dirty = true; - - if (node.autoPosition) { - this._sortNodes(); - - for (var i = 0;; ++i) { - var x = i % this.width; - var y = Math.floor(i / this.width); - if (x + node.width > this.width) { - continue; - } - if (!_.find(this.nodes, _.bind(Utils._isAddNodeIntercepted, {x: x, y: y, node: node}))) { - node.x = x; - node.y = y; - break; - } - } - } - - this.nodes.push(node); - if (typeof triggerAddEvent != 'undefined' && triggerAddEvent) { - this._addedNodes.push(_.clone(node)); - } - - this._fixCollisions(node); - this._packNodes(); - this._notify(); - return node; - }; - - GridStackEngine.prototype.removeNode = function(node, detachNode) { - detachNode = typeof detachNode === 'undefined' ? true : detachNode; - this._removedNodes.push(_.clone(node)); - node._id = null; - this.nodes = _.without(this.nodes, node); - this._packNodes(); - this._notify(node, detachNode); - }; - - GridStackEngine.prototype.canMoveNode = function(node, x, y, width, height) { - if (!this.isNodeChangedPosition(node, x, y, width, height)) { - return false; - } - var hasLocked = Boolean(_.find(this.nodes, function(n) { return n.locked; })); - - if (!this.height && !hasLocked) { - return true; - } - - var clonedNode; - var clone = new GridStackEngine( - this.width, - null, - this.float, - 0, - _.map(this.nodes, function(n) { - if (n == node) { - clonedNode = $.extend({}, n); - return clonedNode; - } - return $.extend({}, n); - })); - - if (typeof clonedNode === 'undefined') { - return true; - } - - clone.moveNode(clonedNode, x, y, width, height); - - var res = true; - - if (hasLocked) { - res &= !Boolean(_.find(clone.nodes, function(n) { - return n != clonedNode && Boolean(n.locked) && Boolean(n._dirty); - })); - } - if (this.height) { - res &= clone.getGridHeight() <= this.height; - } - - return res; - }; - - GridStackEngine.prototype.canBePlacedWithRespectToHeight = function(node) { - if (!this.height) { - return true; - } - - var clone = new GridStackEngine( - this.width, - null, - this.float, - 0, - _.map(this.nodes, function(n) { return $.extend({}, n); })); - clone.addNode(node); - return clone.getGridHeight() <= this.height; - }; - - GridStackEngine.prototype.isNodeChangedPosition = function(node, x, y, width, height) { - if (typeof x != 'number') { x = node.x; } - if (typeof y != 'number') { y = node.y; } - if (typeof width != 'number') { width = node.width; } - if (typeof height != 'number') { height = node.height; } - - if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); } - if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); } - if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); } - if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); } - - if (node.x == x && node.y == y && node.width == width && node.height == height) { - return false; - } - return true; - }; - - GridStackEngine.prototype.moveNode = function(node, x, y, width, height, noPack) { - if (!this.isNodeChangedPosition(node, x, y, width, height)) { - return node; - } - if (typeof x != 'number') { x = node.x; } - if (typeof y != 'number') { y = node.y; } - if (typeof width != 'number') { width = node.width; } - if (typeof height != 'number') { height = node.height; } - - if (typeof node.maxWidth != 'undefined') { width = Math.min(width, node.maxWidth); } - if (typeof node.maxHeight != 'undefined') { height = Math.min(height, node.maxHeight); } - if (typeof node.minWidth != 'undefined') { width = Math.max(width, node.minWidth); } - if (typeof node.minHeight != 'undefined') { height = Math.max(height, node.minHeight); } - - if (node.x == x && node.y == y && node.width == width && node.height == height) { - return node; - } - - var resizing = node.width != width; - node._dirty = true; - - node.x = x; - node.y = y; - node.width = width; - node.height = height; - - node.lastTriedX = x; - node.lastTriedY = y; - node.lastTriedWidth = width; - node.lastTriedHeight = height; - - node = this._prepareNode(node, resizing); - - this._fixCollisions(node); - if (!noPack) { - this._packNodes(); - this._notify(); - } - return node; - }; - - GridStackEngine.prototype.getGridHeight = function() { - return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0); - }; - - GridStackEngine.prototype.beginUpdate = function(node) { - _.each(this.nodes, function(n) { - n._origY = n.y; - }); - node._updating = true; - }; - - GridStackEngine.prototype.endUpdate = function() { - _.each(this.nodes, function(n) { - n._origY = n.y; - }); - var n = _.find(this.nodes, function(n) { return n._updating; }); - if (n) { - n._updating = false; - } - }; - - var GridStack = function(el, opts) { - var self = this; - var oneColumnMode, isAutoCellHeight; - - opts = opts || {}; - - this.container = $(el); - - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - if (typeof opts.handle_class !== 'undefined') { - opts.handleClass = opts.handle_class; - obsoleteOpts('handle_class', 'handleClass'); - } - if (typeof opts.item_class !== 'undefined') { - opts.itemClass = opts.item_class; - obsoleteOpts('item_class', 'itemClass'); - } - if (typeof opts.placeholder_class !== 'undefined') { - opts.placeholderClass = opts.placeholder_class; - obsoleteOpts('placeholder_class', 'placeholderClass'); - } - if (typeof opts.placeholder_text !== 'undefined') { - opts.placeholderText = opts.placeholder_text; - obsoleteOpts('placeholder_text', 'placeholderText'); - } - if (typeof opts.cell_height !== 'undefined') { - opts.cellHeight = opts.cell_height; - obsoleteOpts('cell_height', 'cellHeight'); - } - if (typeof opts.vertical_margin !== 'undefined') { - opts.verticalMargin = opts.vertical_margin; - obsoleteOpts('vertical_margin', 'verticalMargin'); - } - if (typeof opts.min_width !== 'undefined') { - opts.minWidth = opts.min_width; - obsoleteOpts('min_width', 'minWidth'); - } - if (typeof opts.static_grid !== 'undefined') { - opts.staticGrid = opts.static_grid; - obsoleteOpts('static_grid', 'staticGrid'); - } - if (typeof opts.is_nested !== 'undefined') { - opts.isNested = opts.is_nested; - obsoleteOpts('is_nested', 'isNested'); - } - if (typeof opts.always_show_resize_handle !== 'undefined') { - opts.alwaysShowResizeHandle = opts.always_show_resize_handle; - obsoleteOpts('always_show_resize_handle', 'alwaysShowResizeHandle'); - } - // jscs:enable requireCamelCaseOrUpperCaseIdentifiers - - opts.itemClass = opts.itemClass || 'grid-stack-item'; - var isNested = this.container.closest('.' + opts.itemClass).length > 0; - - this.opts = _.defaults(opts || {}, { - width: parseInt(this.container.attr('data-gs-width')) || 12, - height: parseInt(this.container.attr('data-gs-height')) || 0, - itemClass: 'grid-stack-item', - placeholderClass: 'grid-stack-placeholder', - placeholderText: '', - handle: '.grid-stack-item-content', - handleClass: null, - cellHeight: 60, - verticalMargin: 20, - auto: true, - minWidth: 768, - float: false, - staticGrid: false, - _class: 'grid-stack-instance-' + (Math.random() * 10000).toFixed(0), - animate: Boolean(this.container.attr('data-gs-animate')) || false, - alwaysShowResizeHandle: opts.alwaysShowResizeHandle || false, - resizable: _.defaults(opts.resizable || {}, { - autoHide: !(opts.alwaysShowResizeHandle || false), - handles: 'se' - }), - draggable: _.defaults(opts.draggable || {}, { - handle: (opts.handleClass ? '.' + opts.handleClass : (opts.handle ? opts.handle : '')) || - '.grid-stack-item-content', - scroll: false, - appendTo: 'body' - }), - disableDrag: opts.disableDrag || false, - disableResize: opts.disableResize || false, - rtl: 'auto', - removable: false, - removableOptions: _.defaults(opts.removableOptions || {}, { - accept: '.' + opts.itemClass - }), - removeTimeout: 2000, - verticalMarginUnit: 'px', - cellHeightUnit: 'px', - disableOneColumnMode: opts.disableOneColumnMode || false, - oneColumnModeClass: opts.oneColumnModeClass || 'grid-stack-one-column-mode', - ddPlugin: null - }); - - if (this.opts.ddPlugin === false) { - this.opts.ddPlugin = GridStackDragDropPlugin; - } else if (this.opts.ddPlugin === null) { - this.opts.ddPlugin = _.first(GridStackDragDropPlugin.registeredPlugins) || GridStackDragDropPlugin; - } - - this.dd = new this.opts.ddPlugin(this); - - if (this.opts.rtl === 'auto') { - this.opts.rtl = this.container.css('direction') === 'rtl'; - } - - if (this.opts.rtl) { - this.container.addClass('grid-stack-rtl'); - } - - this.opts.isNested = isNested; - - isAutoCellHeight = this.opts.cellHeight === 'auto'; - if (isAutoCellHeight) { - self.cellHeight(self.cellWidth(), true); - } else { - this.cellHeight(this.opts.cellHeight, true); - } - this.verticalMargin(this.opts.verticalMargin, true); - - this.container.addClass(this.opts._class); - - this._setStaticClass(); - - if (isNested) { - this.container.addClass('grid-stack-nested'); - } - - this._initStyles(); - - this.grid = new GridStackEngine(this.opts.width, function(nodes, detachNode) { - detachNode = typeof detachNode === 'undefined' ? true : detachNode; - var maxHeight = 0; - _.each(nodes, function(n) { - if (detachNode && n._id === null) { - if (n.el) { - n.el.remove(); - } - } else { - n.el - .attr('data-gs-x', n.x) - .attr('data-gs-y', n.y) - .attr('data-gs-width', n.width) - .attr('data-gs-height', n.height); - maxHeight = Math.max(maxHeight, n.y + n.height); - } - }); - self._updateStyles(maxHeight + 10); - }, this.opts.float, this.opts.height); - - if (this.opts.auto) { - var elements = []; - var _this = this; - this.container.children('.' + this.opts.itemClass + ':not(.' + this.opts.placeholderClass + ')') - .each(function(index, el) { - el = $(el); - elements.push({ - el: el, - i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width - }); - }); - _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) { - self._prepareElement(i.el); - }).value(); - } - - this.setAnimation(this.opts.animate); - - this.placeholder = $( - '
' + - '
' + this.opts.placeholderText + '
').hide(); - - this._updateContainerHeight(); - - this._updateHeightsOnResize = _.throttle(function() { - self.cellHeight(self.cellWidth(), false); - }, 100); - - this.onResizeHandler = function() { - if (isAutoCellHeight) { - self._updateHeightsOnResize(); - } - - if (self._isOneColumnMode() && !self.opts.disableOneColumnMode) { - if (oneColumnMode) { - return; - } - self.container.addClass(self.opts.oneColumnModeClass); - oneColumnMode = true; - - self.grid._sortNodes(); - _.each(self.grid.nodes, function(node) { - self.container.append(node.el); - - if (self.opts.staticGrid) { - return; - } - self.dd.draggable(node.el, 'disable'); - self.dd.resizable(node.el, 'disable'); - - node.el.trigger('resize'); - }); - } else { - if (!oneColumnMode) { - return; - } - - self.container.removeClass(self.opts.oneColumnModeClass); - oneColumnMode = false; - - if (self.opts.staticGrid) { - return; - } - - _.each(self.grid.nodes, function(node) { - if (!node.noMove && !self.opts.disableDrag) { - self.dd.draggable(node.el, 'enable'); - } - if (!node.noResize && !self.opts.disableResize) { - self.dd.resizable(node.el, 'enable'); - } - - node.el.trigger('resize'); - }); - } - }; - - $(window).resize(this.onResizeHandler); - this.onResizeHandler(); - - if (!self.opts.staticGrid && typeof self.opts.removable === 'string') { - var trashZone = $(self.opts.removable); - if (!this.dd.isDroppable(trashZone)) { - this.dd.droppable(trashZone, self.opts.removableOptions); - } - this.dd - .on(trashZone, 'dropover', function(event, ui) { - var el = $(ui.draggable); - var node = el.data('_gridstack_node'); - if (node._grid !== self) { - return; - } - el.data('inTrashZone', true); - self._setupRemovingTimeout(el); - }) - .on(trashZone, 'dropout', function(event, ui) { - var el = $(ui.draggable); - var node = el.data('_gridstack_node'); - if (node._grid !== self) { - return; - } - el.data('inTrashZone', false); - self._clearRemovingTimeout(el); - }); - } - - if (!self.opts.staticGrid && self.opts.acceptWidgets) { - var draggingElement = null; - - var onDrag = function(event, ui) { - var el = draggingElement; - var node = el.data('_gridstack_node'); - var pos = self.getCellFromPixel({left: event.pageX, top: event.pageY}, true); - var x = Math.max(0, pos.x); - var y = Math.max(0, pos.y); - if (!node._added) { - node._added = true; - - node.el = el; - node.autoPosition = true; - node.x = x; - node.y = y; - self.grid.cleanNodes(); - self.grid.beginUpdate(node); - self.grid.addNode(node); - - self.container.append(self.placeholder); - self.placeholder - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height) - .show(); - node.el = self.placeholder; - node._beforeDragX = node.x; - node._beforeDragY = node.y; - - self._updateContainerHeight(); - } - if (!self.grid.canMoveNode(node, x, y)) { - return; - } - self.grid.moveNode(node, x, y); - self._updateContainerHeight(); - }; - - this.dd - .droppable(self.container, { - accept: function(el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (node && node._grid === self) { - return false; - } - return el.is(self.opts.acceptWidgets === true ? '.grid-stack-item' : self.opts.acceptWidgets); - } - }) - .on(self.container, 'dropover', function(event, ui) { - var offset = self.container.offset(); - var el = $(ui.draggable); - var cellWidth = self.cellWidth(); - var cellHeight = self.cellHeight(); - var origNode = el.data('_gridstack_node'); - - var width = origNode ? origNode.width : (Math.ceil(el.outerWidth() / cellWidth)); - var height = origNode ? origNode.height : (Math.ceil(el.outerHeight() / cellHeight)); - - draggingElement = el; - - var node = self.grid._prepareNode({width: width, height: height, _added: false, _temporary: true}); - el.data('_gridstack_node', node); - el.data('_gridstack_node_orig', origNode); - - el.on('drag', onDrag); - }) - .on(self.container, 'dropout', function(event, ui) { - var el = $(ui.draggable); - if (!el.data('_gridstack_node')) { - return; - } - el.unbind('drag', onDrag); - var node = el.data('_gridstack_node'); - node.el = null; - self.grid.removeNode(node); - self.placeholder.detach(); - self._updateContainerHeight(); - el.data('_gridstack_node', el.data('_gridstack_node_orig')); - }) - .on(self.container, 'drop', function(event, ui) { - self.placeholder.detach(); - - var node = $(ui.draggable).data('_gridstack_node'); - node._grid = self; - var el = $(ui.draggable).clone(false); - el.data('_gridstack_node', node); - var originalNode = $(ui.draggable).data('_gridstack_node_orig'); - if (typeof originalNode !== 'undefined' && typeof originalNode._grid !== 'undefined') { - originalNode._grid._triggerRemoveEvent(); - } - $(ui.helper).remove(); - node.el = el; - self.placeholder.hide(); - Utils.removePositioningStyles(el); - el.find('div.ui-resizable-handle').remove(); - - el - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height) - .addClass(self.opts.itemClass) - .enableSelection() - .removeData('draggable') - .removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled') - .unbind('drag', onDrag); - self.container.append(el); - self._prepareElementsByNode(el, node); - self._updateContainerHeight(); - self.grid._addedNodes.push(node); - self._triggerAddEvent(); - self._triggerChangeEvent(); - - self.grid.endUpdate(); - $(ui.draggable).unbind('drag', onDrag); - $(ui.draggable).removeData('_gridstack_node'); - $(ui.draggable).removeData('_gridstack_node_orig'); - }); - } - }; - - GridStack.prototype._triggerChangeEvent = function(forceTrigger) { - var elements = this.grid.getDirtyNodes(); - var hasChanges = false; - - var eventParams = []; - if (elements && elements.length) { - eventParams.push(elements); - hasChanges = true; - } - - if (hasChanges || forceTrigger === true) { - this.container.trigger('change', eventParams); - } - }; - - GridStack.prototype._triggerAddEvent = function() { - if (this.grid._addedNodes && this.grid._addedNodes.length > 0) { - this.container.trigger('added', [_.map(this.grid._addedNodes, _.clone)]); - this.grid._addedNodes = []; - } - }; - - GridStack.prototype._triggerRemoveEvent = function() { - if (this.grid._removedNodes && this.grid._removedNodes.length > 0) { - this.container.trigger('removed', [_.map(this.grid._removedNodes, _.clone)]); - this.grid._removedNodes = []; - } - }; - - GridStack.prototype._initStyles = function() { - if (this._stylesId) { - Utils.removeStylesheet(this._stylesId); - } - this._stylesId = 'gridstack-style-' + (Math.random() * 100000).toFixed(); - this._styles = Utils.createStylesheet(this._stylesId); - if (this._styles !== null) { - this._styles._max = 0; - } - }; - - GridStack.prototype._updateStyles = function(maxHeight) { - if (this._styles === null || typeof this._styles === 'undefined') { - return; - } - - var prefix = '.' + this.opts._class + ' .' + this.opts.itemClass; - var self = this; - var getHeight; - - if (typeof maxHeight == 'undefined') { - maxHeight = this._styles._max; - } - if (this._styles._max !== 0 && maxHeight <= this._styles._max) { // Keep this._styles._max increasing - return ; - } - this._initStyles(); - this._updateContainerHeight(); - if (!this.opts.cellHeight) { // The rest will be handled by CSS - return ; - } - - if (!this.opts.verticalMargin || this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { - getHeight = function(nbRows, nbMargins) { - return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + - self.opts.cellHeightUnit; - }; - } else { - getHeight = function(nbRows, nbMargins) { - if (!nbRows || !nbMargins) { - return (self.opts.cellHeight * nbRows + self.opts.verticalMargin * nbMargins) + - self.opts.cellHeightUnit; - } - return 'calc(' + ((self.opts.cellHeight * nbRows) + self.opts.cellHeightUnit) + ' + ' + - ((self.opts.verticalMargin * nbMargins) + self.opts.verticalMarginUnit) + ')'; - }; - } - - if (this._styles._max === 0) { - Utils.insertCSSRule(this._styles, prefix, 'min-height: ' + getHeight(1, 0) + ';', 0); - } - - if (maxHeight > this._styles._max) { - for (var i = this._styles._max; i < maxHeight; ++i) { - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-height="' + (i + 1) + '"]', - 'height: ' + getHeight(i + 1, i) + ';', - i - ); - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-min-height="' + (i + 1) + '"]', - 'min-height: ' + getHeight(i + 1, i) + ';', - i - ); - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-max-height="' + (i + 1) + '"]', - 'max-height: ' + getHeight(i + 1, i) + ';', - i - ); - Utils.insertCSSRule(this._styles, - prefix + '[data-gs-y="' + i + '"]', - 'top: ' + getHeight(i, i) + ';', - i - ); - } - this._styles._max = maxHeight; - } - }; - - GridStack.prototype._updateContainerHeight = function() { - if (this.grid._updateCounter) { - return; - } - var height = this.grid.getGridHeight(); - var minHeight = parseInt(this.container.css('min-height')) / this.cellHeight(); - if (height < minHeight) { - height = minHeight; - } - this.container.attr('data-gs-current-height', height); - if (!this.opts.cellHeight) { - return ; - } - if (!this.opts.verticalMargin) { - this.container.css('height', (height * (this.opts.cellHeight)) + this.opts.cellHeightUnit); - } else if (this.opts.cellHeightUnit === this.opts.verticalMarginUnit) { - this.container.css('height', (height * (this.opts.cellHeight + this.opts.verticalMargin) - - this.opts.verticalMargin) + this.opts.cellHeightUnit); - } else { - this.container.css('height', 'calc(' + ((height * (this.opts.cellHeight)) + this.opts.cellHeightUnit) + - ' + ' + ((height * (this.opts.verticalMargin - 1)) + this.opts.verticalMarginUnit) + ')'); - } - }; - - GridStack.prototype._isOneColumnMode = function() { - return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= - this.opts.minWidth; - }; - - GridStack.prototype._setupRemovingTimeout = function(el) { - var self = this; - var node = $(el).data('_gridstack_node'); - - if (node._removeTimeout || !self.opts.removable) { - return; - } - node._removeTimeout = setTimeout(function() { - el.addClass('grid-stack-item-removing'); - node._isAboutToRemove = true; - }, self.opts.removeTimeout); - }; - - GridStack.prototype._clearRemovingTimeout = function(el) { - var node = $(el).data('_gridstack_node'); - - if (!node._removeTimeout) { - return; - } - clearTimeout(node._removeTimeout); - node._removeTimeout = null; - el.removeClass('grid-stack-item-removing'); - node._isAboutToRemove = false; - }; - - GridStack.prototype._prepareElementsByNode = function(el, node) { - var self = this; - - var cellWidth; - var cellHeight; - - var dragOrResize = function(event, ui) { - var x = Math.round(ui.position.left / cellWidth); - var y = Math.floor((ui.position.top + cellHeight / 2) / cellHeight); - var width; - var height; - - if (event.type != 'drag') { - width = Math.round(ui.size.width / cellWidth); - height = Math.round(ui.size.height / cellHeight); - } - - if (event.type == 'drag') { - if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 || - (!self.grid.float && y > self.grid.getGridHeight())) { - if (!node._temporaryRemoved) { - if (self.opts.removable === true) { - self._setupRemovingTimeout(el); - } - - x = node._beforeDragX; - y = node._beforeDragY; - - self.placeholder.detach(); - self.placeholder.hide(); - self.grid.removeNode(node); - self._updateContainerHeight(); - - node._temporaryRemoved = true; - } - } else { - self._clearRemovingTimeout(el); - - if (node._temporaryRemoved) { - self.grid.addNode(node); - self.placeholder - .attr('data-gs-x', x) - .attr('data-gs-y', y) - .attr('data-gs-width', width) - .attr('data-gs-height', height) - .show(); - self.container.append(self.placeholder); - node.el = self.placeholder; - node._temporaryRemoved = false; - } - } - } else if (event.type == 'resize') { - if (x < 0) { - return; - } - } - // width and height are undefined if not resizing - var lastTriedWidth = typeof width !== 'undefined' ? width : node.lastTriedWidth; - var lastTriedHeight = typeof height !== 'undefined' ? height : node.lastTriedHeight; - if (!self.grid.canMoveNode(node, x, y, width, height) || - (node.lastTriedX === x && node.lastTriedY === y && - node.lastTriedWidth === lastTriedWidth && node.lastTriedHeight === lastTriedHeight)) { - return; - } - node.lastTriedX = x; - node.lastTriedY = y; - node.lastTriedWidth = width; - node.lastTriedHeight = height; - self.grid.moveNode(node, x, y, width, height); - self._updateContainerHeight(); - }; - - var onStartMoving = function(event, ui) { - self.container.append(self.placeholder); - var o = $(this); - self.grid.cleanNodes(); - self.grid.beginUpdate(node); - cellWidth = self.cellWidth(); - var strictCellHeight = Math.ceil(o.outerHeight() / o.attr('data-gs-height')); - cellHeight = self.container.height() / parseInt(self.container.attr('data-gs-current-height')); - self.placeholder - .attr('data-gs-x', o.attr('data-gs-x')) - .attr('data-gs-y', o.attr('data-gs-y')) - .attr('data-gs-width', o.attr('data-gs-width')) - .attr('data-gs-height', o.attr('data-gs-height')) - .show(); - node.el = self.placeholder; - node._beforeDragX = node.x; - node._beforeDragY = node.y; - - self.dd.resizable(el, 'option', 'minWidth', cellWidth * (node.minWidth || 1)); - self.dd.resizable(el, 'option', 'minHeight', strictCellHeight * (node.minHeight || 1)); - - if (event.type == 'resizestart') { - o.find('.grid-stack-item').trigger('resizestart'); - } - }; - - var onEndMoving = function(event, ui) { - var o = $(this); - if (!o.data('_gridstack_node')) { - return; - } - - var forceNotify = false; - self.placeholder.detach(); - node.el = o; - self.placeholder.hide(); - - if (node._isAboutToRemove) { - forceNotify = true; - var gridToNotify = el.data('_gridstack_node')._grid; - gridToNotify._triggerRemoveEvent(); - el.removeData('_gridstack_node'); - el.remove(); - } else { - self._clearRemovingTimeout(el); - if (!node._temporaryRemoved) { - Utils.removePositioningStyles(o); - o - .attr('data-gs-x', node.x) - .attr('data-gs-y', node.y) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height); - } else { - Utils.removePositioningStyles(o); - o - .attr('data-gs-x', node._beforeDragX) - .attr('data-gs-y', node._beforeDragY) - .attr('data-gs-width', node.width) - .attr('data-gs-height', node.height); - node.x = node._beforeDragX; - node.y = node._beforeDragY; - self.grid.addNode(node); - } - } - self._updateContainerHeight(); - self._triggerChangeEvent(forceNotify); - - self.grid.endUpdate(); - - var nestedGrids = o.find('.grid-stack'); - if (nestedGrids.length && event.type == 'resizestop') { - nestedGrids.each(function(index, el) { - $(el).data('gridstack').onResizeHandler(); - }); - o.find('.grid-stack-item').trigger('resizestop'); - o.find('.grid-stack-item').trigger('gsresizestop'); - } - if (event.type == 'resizestop') { - self.container.trigger('gsresizestop', o); - } - }; - - this.dd - .draggable(el, { - start: onStartMoving, - stop: onEndMoving, - drag: dragOrResize - }) - .resizable(el, { - start: onStartMoving, - stop: onEndMoving, - resize: dragOrResize - }); - - if (node.noMove || (this._isOneColumnMode() && !self.opts.disableOneColumnMode) || this.opts.disableDrag || - this.opts.staticGrid) { - this.dd.draggable(el, 'disable'); - } - - if (node.noResize || (this._isOneColumnMode() && !self.opts.disableOneColumnMode) || this.opts.disableResize || - this.opts.staticGrid) { - this.dd.resizable(el, 'disable'); - } - - el.attr('data-gs-locked', node.locked ? 'yes' : null); - }; - - GridStack.prototype._prepareElement = function(el, triggerAddEvent) { - triggerAddEvent = typeof triggerAddEvent != 'undefined' ? triggerAddEvent : false; - var self = this; - el = $(el); - - el.addClass(this.opts.itemClass); - var node = self.grid.addNode({ - x: el.attr('data-gs-x'), - y: el.attr('data-gs-y'), - width: el.attr('data-gs-width'), - height: el.attr('data-gs-height'), - maxWidth: el.attr('data-gs-max-width'), - minWidth: el.attr('data-gs-min-width'), - maxHeight: el.attr('data-gs-max-height'), - minHeight: el.attr('data-gs-min-height'), - autoPosition: Utils.toBool(el.attr('data-gs-auto-position')), - noResize: Utils.toBool(el.attr('data-gs-no-resize')), - noMove: Utils.toBool(el.attr('data-gs-no-move')), - locked: Utils.toBool(el.attr('data-gs-locked')), - resizeHandles: el.attr('data-gs-resize-handles'), - el: el, - id: el.attr('data-gs-id'), - _grid: self - }, triggerAddEvent); - el.data('_gridstack_node', node); - - this._prepareElementsByNode(el, node); - }; - - GridStack.prototype.setAnimation = function(enable) { - if (enable) { - this.container.addClass('grid-stack-animate'); - } else { - this.container.removeClass('grid-stack-animate'); - } - }; - - GridStack.prototype.addWidget = function(el, x, y, width, height, autoPosition, minWidth, maxWidth, - minHeight, maxHeight, id) { - el = $(el); - if (typeof x != 'undefined') { el.attr('data-gs-x', x); } - if (typeof y != 'undefined') { el.attr('data-gs-y', y); } - if (typeof width != 'undefined') { el.attr('data-gs-width', width); } - if (typeof height != 'undefined') { el.attr('data-gs-height', height); } - if (typeof autoPosition != 'undefined') { el.attr('data-gs-auto-position', autoPosition ? 'yes' : null); } - if (typeof minWidth != 'undefined') { el.attr('data-gs-min-width', minWidth); } - if (typeof maxWidth != 'undefined') { el.attr('data-gs-max-width', maxWidth); } - if (typeof minHeight != 'undefined') { el.attr('data-gs-min-height', minHeight); } - if (typeof maxHeight != 'undefined') { el.attr('data-gs-max-height', maxHeight); } - if (typeof id != 'undefined') { el.attr('data-gs-id', id); } - this.container.append(el); - this._prepareElement(el, true); - this._triggerAddEvent(); - this._updateContainerHeight(); - this._triggerChangeEvent(true); - - return el; - }; - - GridStack.prototype.makeWidget = function(el) { - el = $(el); - this._prepareElement(el, true); - this._triggerAddEvent(); - this._updateContainerHeight(); - this._triggerChangeEvent(true); - - return el; - }; - - GridStack.prototype.willItFit = function(x, y, width, height, autoPosition) { - var node = {x: x, y: y, width: width, height: height, autoPosition: autoPosition}; - return this.grid.canBePlacedWithRespectToHeight(node); - }; - - GridStack.prototype.removeWidget = function(el, detachNode) { - detachNode = typeof detachNode === 'undefined' ? true : detachNode; - el = $(el); - var node = el.data('_gridstack_node'); - - // For Meteor support: https://github.com/troolee/gridstack.js/pull/272 - if (!node) { - node = this.grid.getNodeDataByDOMEl(el); - } - - this.grid.removeNode(node, detachNode); - el.removeData('_gridstack_node'); - this._updateContainerHeight(); - if (detachNode) { - el.remove(); - } - this._triggerChangeEvent(true); - this._triggerRemoveEvent(); - }; - - GridStack.prototype.removeAll = function(detachNode) { - _.each(this.grid.nodes, _.bind(function(node) { - this.removeWidget(node.el, detachNode); - }, this)); - this.grid.nodes = []; - this._updateContainerHeight(); - }; - - GridStack.prototype.destroy = function(detachGrid) { - $(window).off('resize', this.onResizeHandler); - this.disable(); - if (typeof detachGrid != 'undefined' && !detachGrid) { - this.removeAll(false); - this.container.removeData('gridstack'); - } else { - this.container.remove(); - } - Utils.removeStylesheet(this._stylesId); - if (this.grid) { - this.grid = null; - } - }; - - GridStack.prototype.resizable = function(el, val) { - var self = this; - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - node.noResize = !(val || false); - if (node.noResize || (self._isOneColumnMode() && !self.opts.disableOneColumnMode)) { - self.dd.resizable(el, 'disable'); - } else { - self.dd.resizable(el, 'enable'); - } - }); - return this; - }; - - GridStack.prototype.movable = function(el, val) { - var self = this; - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - node.noMove = !(val || false); - if (node.noMove || (self._isOneColumnMode() && !self.opts.disableOneColumnMode)) { - self.dd.draggable(el, 'disable'); - el.removeClass('ui-draggable-handle'); - } else { - self.dd.draggable(el, 'enable'); - el.addClass('ui-draggable-handle'); - } - }); - return this; - }; - - GridStack.prototype.enableMove = function(doEnable, includeNewWidgets) { - this.movable(this.container.children('.' + this.opts.itemClass), doEnable); - if (includeNewWidgets) { - this.opts.disableDrag = !doEnable; - } - }; - - GridStack.prototype.enableResize = function(doEnable, includeNewWidgets) { - this.resizable(this.container.children('.' + this.opts.itemClass), doEnable); - if (includeNewWidgets) { - this.opts.disableResize = !doEnable; - } - }; - - GridStack.prototype.disable = function() { - this.movable(this.container.children('.' + this.opts.itemClass), false); - this.resizable(this.container.children('.' + this.opts.itemClass), false); - this.container.trigger('disable'); - }; - - GridStack.prototype.enable = function() { - this.movable(this.container.children('.' + this.opts.itemClass), true); - this.resizable(this.container.children('.' + this.opts.itemClass), true); - this.container.trigger('enable'); - }; - - GridStack.prototype.locked = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - node.locked = (val || false); - el.attr('data-gs-locked', node.locked ? 'yes' : null); - }); - return this; - }; - - GridStack.prototype.maxHeight = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.maxHeight = (val || false); - el.attr('data-gs-max-height', val); - } - }); - return this; - }; - - GridStack.prototype.minHeight = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.minHeight = (val || false); - el.attr('data-gs-min-height', val); - } - }); - return this; - }; - - GridStack.prototype.maxWidth = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.maxWidth = (val || false); - el.attr('data-gs-max-width', val); - } - }); - return this; - }; - - GridStack.prototype.minWidth = function(el, val) { - el = $(el); - el.each(function(index, el) { - el = $(el); - var node = el.data('_gridstack_node'); - if (typeof node === 'undefined' || node === null) { - return; - } - - if (!isNaN(val)) { - node.minWidth = (val || false); - el.attr('data-gs-min-width', val); - } - }); - return this; - }; - - GridStack.prototype._updateElement = function(el, callback) { - el = $(el).first(); - var node = el.data('_gridstack_node'); - if (typeof node == 'undefined' || node === null) { - return; - } - - var self = this; - - self.grid.cleanNodes(); - self.grid.beginUpdate(node); - - callback.call(this, el, node); - - self._updateContainerHeight(); - self._triggerChangeEvent(); - - self.grid.endUpdate(); - }; - - GridStack.prototype.resize = function(el, width, height) { - this._updateElement(el, function(el, node) { - width = (width !== null && typeof width != 'undefined') ? width : node.width; - height = (height !== null && typeof height != 'undefined') ? height : node.height; - - this.grid.moveNode(node, node.x, node.y, width, height); - }); - }; - - GridStack.prototype.move = function(el, x, y) { - this._updateElement(el, function(el, node) { - x = (x !== null && typeof x != 'undefined') ? x : node.x; - y = (y !== null && typeof y != 'undefined') ? y : node.y; - - this.grid.moveNode(node, x, y, node.width, node.height); - }); - }; - - GridStack.prototype.update = function(el, x, y, width, height) { - this._updateElement(el, function(el, node) { - x = (x !== null && typeof x != 'undefined') ? x : node.x; - y = (y !== null && typeof y != 'undefined') ? y : node.y; - width = (width !== null && typeof width != 'undefined') ? width : node.width; - height = (height !== null && typeof height != 'undefined') ? height : node.height; - - this.grid.moveNode(node, x, y, width, height); - }); - }; - - GridStack.prototype.verticalMargin = function(val, noUpdate) { - if (typeof val == 'undefined') { - return this.opts.verticalMargin; - } - - var heightData = Utils.parseHeight(val); - - if (this.opts.verticalMarginUnit === heightData.unit && this.opts.height === heightData.height) { - return ; - } - this.opts.verticalMarginUnit = heightData.unit; - this.opts.verticalMargin = heightData.height; - - if (!noUpdate) { - this._updateStyles(); - } - }; - - GridStack.prototype.cellHeight = function(val, noUpdate) { - if (typeof val == 'undefined') { - if (this.opts.cellHeight) { - return this.opts.cellHeight; - } - var o = this.container.children('.' + this.opts.itemClass).first(); - return Math.ceil(o.outerHeight() / o.attr('data-gs-height')); - } - var heightData = Utils.parseHeight(val); - - if (this.opts.cellHeightUnit === heightData.heightUnit && this.opts.height === heightData.height) { - return ; - } - this.opts.cellHeightUnit = heightData.unit; - this.opts.cellHeight = heightData.height; - - if (!noUpdate) { - this._updateStyles(); - } - - }; - - GridStack.prototype.cellWidth = function() { - return Math.round(this.container.outerWidth() / this.opts.width); - }; - - GridStack.prototype.getCellFromPixel = function(position, useOffset) { - var containerPos = (typeof useOffset != 'undefined' && useOffset) ? - this.container.offset() : this.container.position(); - var relativeLeft = position.left - containerPos.left; - var relativeTop = position.top - containerPos.top; - - var columnWidth = Math.floor(this.container.width() / this.opts.width); - var rowHeight = Math.floor(this.container.height() / parseInt(this.container.attr('data-gs-current-height'))); - - return {x: Math.floor(relativeLeft / columnWidth), y: Math.floor(relativeTop / rowHeight)}; - }; - - GridStack.prototype.batchUpdate = function() { - this.grid.batchUpdate(); - }; - - GridStack.prototype.commit = function() { - this.grid.commit(); - this._updateContainerHeight(); - }; - - GridStack.prototype.isAreaEmpty = function(x, y, width, height) { - return this.grid.isAreaEmpty(x, y, width, height); - }; - - GridStack.prototype.setStatic = function(staticValue) { - this.opts.staticGrid = (staticValue === true); - this.enableMove(!staticValue); - this.enableResize(!staticValue); - this._setStaticClass(); - }; - - GridStack.prototype._setStaticClass = function() { - var staticClassName = 'grid-stack-static'; - - if (this.opts.staticGrid === true) { - this.container.addClass(staticClassName); - } else { - this.container.removeClass(staticClassName); - } - }; - - GridStack.prototype._updateNodeWidths = function(oldWidth, newWidth) { - this.grid._sortNodes(); - this.grid.batchUpdate(); - var node = {}; - for (var i = 0; i < this.grid.nodes.length; i++) { - node = this.grid.nodes[i]; - this.update(node.el, Math.round(node.x * newWidth / oldWidth), undefined, - Math.round(node.width * newWidth / oldWidth), undefined); - } - this.grid.commit(); - }; - - GridStack.prototype.setGridWidth = function(gridWidth,doNotPropagate) { - this.container.removeClass('grid-stack-' + this.opts.width); - if (doNotPropagate !== true) { - this._updateNodeWidths(this.opts.width, gridWidth); - } - this.opts.width = gridWidth; - this.grid.width = gridWidth; - this.container.addClass('grid-stack-' + gridWidth); - }; - - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - GridStackEngine.prototype.batch_update = obsolete(GridStackEngine.prototype.batchUpdate); - GridStackEngine.prototype._fix_collisions = obsolete(GridStackEngine.prototype._fixCollisions, - '_fix_collisions', '_fixCollisions'); - GridStackEngine.prototype.is_area_empty = obsolete(GridStackEngine.prototype.isAreaEmpty, - 'is_area_empty', 'isAreaEmpty'); - GridStackEngine.prototype._sort_nodes = obsolete(GridStackEngine.prototype._sortNodes, - '_sort_nodes', '_sortNodes'); - GridStackEngine.prototype._pack_nodes = obsolete(GridStackEngine.prototype._packNodes, - '_pack_nodes', '_packNodes'); - GridStackEngine.prototype._prepare_node = obsolete(GridStackEngine.prototype._prepareNode, - '_prepare_node', '_prepareNode'); - GridStackEngine.prototype.clean_nodes = obsolete(GridStackEngine.prototype.cleanNodes, - 'clean_nodes', 'cleanNodes'); - GridStackEngine.prototype.get_dirty_nodes = obsolete(GridStackEngine.prototype.getDirtyNodes, - 'get_dirty_nodes', 'getDirtyNodes'); - GridStackEngine.prototype.add_node = obsolete(GridStackEngine.prototype.addNode, - 'add_node', 'addNode, '); - GridStackEngine.prototype.remove_node = obsolete(GridStackEngine.prototype.removeNode, - 'remove_node', 'removeNode'); - GridStackEngine.prototype.can_move_node = obsolete(GridStackEngine.prototype.canMoveNode, - 'can_move_node', 'canMoveNode'); - GridStackEngine.prototype.move_node = obsolete(GridStackEngine.prototype.moveNode, - 'move_node', 'moveNode'); - GridStackEngine.prototype.get_grid_height = obsolete(GridStackEngine.prototype.getGridHeight, - 'get_grid_height', 'getGridHeight'); - GridStackEngine.prototype.begin_update = obsolete(GridStackEngine.prototype.beginUpdate, - 'begin_update', 'beginUpdate'); - GridStackEngine.prototype.end_update = obsolete(GridStackEngine.prototype.endUpdate, - 'end_update', 'endUpdate'); - GridStackEngine.prototype.can_be_placed_with_respect_to_height = - obsolete(GridStackEngine.prototype.canBePlacedWithRespectToHeight, - 'can_be_placed_with_respect_to_height', 'canBePlacedWithRespectToHeight'); - GridStack.prototype._trigger_change_event = obsolete(GridStack.prototype._triggerChangeEvent, - '_trigger_change_event', '_triggerChangeEvent'); - GridStack.prototype._init_styles = obsolete(GridStack.prototype._initStyles, - '_init_styles', '_initStyles'); - GridStack.prototype._update_styles = obsolete(GridStack.prototype._updateStyles, - '_update_styles', '_updateStyles'); - GridStack.prototype._update_container_height = obsolete(GridStack.prototype._updateContainerHeight, - '_update_container_height', '_updateContainerHeight'); - GridStack.prototype._is_one_column_mode = obsolete(GridStack.prototype._isOneColumnMode, - '_is_one_column_mode','_isOneColumnMode'); - GridStack.prototype._prepare_element = obsolete(GridStack.prototype._prepareElement, - '_prepare_element', '_prepareElement'); - GridStack.prototype.set_animation = obsolete(GridStack.prototype.setAnimation, - 'set_animation', 'setAnimation'); - GridStack.prototype.add_widget = obsolete(GridStack.prototype.addWidget, - 'add_widget', 'addWidget'); - GridStack.prototype.make_widget = obsolete(GridStack.prototype.makeWidget, - 'make_widget', 'makeWidget'); - GridStack.prototype.will_it_fit = obsolete(GridStack.prototype.willItFit, - 'will_it_fit', 'willItFit'); - GridStack.prototype.remove_widget = obsolete(GridStack.prototype.removeWidget, - 'remove_widget', 'removeWidget'); - GridStack.prototype.remove_all = obsolete(GridStack.prototype.removeAll, - 'remove_all', 'removeAll'); - GridStack.prototype.min_height = obsolete(GridStack.prototype.minHeight, - 'min_height', 'minHeight'); - GridStack.prototype.min_width = obsolete(GridStack.prototype.minWidth, - 'min_width', 'minWidth'); - GridStack.prototype._update_element = obsolete(GridStack.prototype._updateElement, - '_update_element', '_updateElement'); - GridStack.prototype.cell_height = obsolete(GridStack.prototype.cellHeight, - 'cell_height', 'cellHeight'); - GridStack.prototype.cell_width = obsolete(GridStack.prototype.cellWidth, - 'cell_width', 'cellWidth'); - GridStack.prototype.get_cell_from_pixel = obsolete(GridStack.prototype.getCellFromPixel, - 'get_cell_from_pixel', 'getCellFromPixel'); - GridStack.prototype.batch_update = obsolete(GridStack.prototype.batchUpdate, - 'batch_update', 'batchUpdate'); - GridStack.prototype.is_area_empty = obsolete(GridStack.prototype.isAreaEmpty, - 'is_area_empty', 'isAreaEmpty'); - GridStack.prototype.set_static = obsolete(GridStack.prototype.setStatic, - 'set_static', 'setStatic'); - GridStack.prototype._set_static_class = obsolete(GridStack.prototype._setStaticClass, - '_set_static_class', '_setStaticClass'); - // jscs:enable requireCamelCaseOrUpperCaseIdentifiers - - scope.GridStackUI = GridStack; - - scope.GridStackUI.Utils = Utils; - scope.GridStackUI.Engine = GridStackEngine; - scope.GridStackUI.GridStackDragDropPlugin = GridStackDragDropPlugin; - - $.fn.gridstack = function(opts) { - return this.each(function() { - var o = $(this); - if (!o.data('gridstack')) { - o - .data('gridstack', new GridStack(this, opts)); - } - }); - }; - - return scope.GridStackUI; -}); diff --git a/dist/gridstack.min.css b/dist/gridstack.min.css deleted file mode 100644 index 7a66c58ad..000000000 --- a/dist/gridstack.min.css +++ /dev/null @@ -1 +0,0 @@ -:root .grid-stack-item>.ui-resizable-handle{filter:none}.grid-stack{position:relative}.grid-stack.grid-stack-rtl{direction:ltr}.grid-stack.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack .grid-stack-placeholder>.placeholder-content{border:1px dashed #d3d3d3;margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;text-align:center}.grid-stack>.grid-stack-item{min-width:8.3333333333%;position:absolute;padding:0}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack>.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack>.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack>.grid-stack-item.ui-draggable-dragging,.grid-stack>.grid-stack-item.ui-resizable-resizing{z-index:100}.grid-stack>.grid-stack-item.ui-draggable-dragging>.grid-stack-item-content,.grid-stack>.grid-stack-item.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,.2);opacity:.8}.grid-stack>.grid-stack-item>.ui-resizable-se,.grid-stack>.grid-stack-item>.ui-resizable-sw{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);background-repeat:no-repeat;background-position:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.grid-stack>.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;left:10px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:0;left:25px;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;right:10px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;right:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item>.ui-resizable-se{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);cursor:se-resize;width:20px;height:20px;right:10px;bottom:0}.grid-stack>.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:0;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px;left:10px;bottom:0}.grid-stack>.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;left:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none!important}.grid-stack>.grid-stack-item[data-gs-width='1']{width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='3']{width:25%}.grid-stack>.grid-stack-item[data-gs-x='3']{left:25%}.grid-stack>.grid-stack-item[data-gs-min-width='3']{min-width:25%}.grid-stack>.grid-stack-item[data-gs-max-width='3']{max-width:25%}.grid-stack>.grid-stack-item[data-gs-width='4']{width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='6']{width:50%}.grid-stack>.grid-stack-item[data-gs-x='6']{left:50%}.grid-stack>.grid-stack-item[data-gs-min-width='6']{min-width:50%}.grid-stack>.grid-stack-item[data-gs-max-width='6']{max-width:50%}.grid-stack>.grid-stack-item[data-gs-width='7']{width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='9']{width:75%}.grid-stack>.grid-stack-item[data-gs-x='9']{left:75%}.grid-stack>.grid-stack-item[data-gs-min-width='9']{min-width:75%}.grid-stack>.grid-stack-item[data-gs-max-width='9']{max-width:75%}.grid-stack>.grid-stack-item[data-gs-width='10']{width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='12']{width:100%}.grid-stack>.grid-stack-item[data-gs-x='12']{left:100%}.grid-stack>.grid-stack-item[data-gs-min-width='12']{min-width:100%}.grid-stack>.grid-stack-item[data-gs-max-width='12']{max-width:100%}.grid-stack.grid-stack-animate,.grid-stack.grid-stack-animate .grid-stack-item{-webkit-transition:left .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:left .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .3s}.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing{-webkit-transition:left 0s,top 0s,height 0s,width 0s;-moz-transition:left 0s,top 0s,height 0s,width 0s;-ms-transition:left 0s,top 0s,height 0s,width 0s;-o-transition:left 0s,top 0s,height 0s,width 0s;transition:left 0s,top 0s,height 0s,width 0s}.grid-stack.grid-stack-one-column-mode{height:auto!important}.grid-stack.grid-stack-one-column-mode>.grid-stack-item{position:relative!important;width:auto!important;left:0!important;top:auto!important;margin-bottom:20px;max-width:none!important}.grid-stack.grid-stack-one-column-mode>.grid-stack-item>.ui-resizable-handle{display:none} \ No newline at end of file diff --git a/dist/gridstack.min.js b/dist/gridstack.min.js deleted file mode 100644 index 3d0f39fbe..000000000 --- a/dist/gridstack.min.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * gridstack.js 1.0.0-dev - * http://troolee.github.io/gridstack.js/ - * (c) 2014-2017 Pavel Reznikov, Dylan Weiss - * gridstack.js may be freely distributed under the MIT license. - * @preserve -*/ -!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(b){}try{_=require("lodash")}catch(b){}a(jQuery,_)}else a(jQuery,_)}(function(a,b){ -// jscs:enable requireCamelCaseOrUpperCaseIdentifiers -/** - * @class GridStackDragDropPlugin - * Base class for drag'n'drop plugin. - */ -function c(a){this.grid=a}var d=window,e=function(a,b,c){var d=function(){return console.warn("gridstack.js: Function `"+b+"` is deprecated as of v0.2.5 and has been replaced with `"+c+"`. It will be **completely** removed in v1.0."),a.apply(this,arguments)};return d.prototype=a.prototype,d},f=function(a,b){console.warn("gridstack.js: Option `"+a+"` is deprecated as of v0.2.5 and has been replaced with `"+b+"`. It will be **completely** removed in v1.0.")},g={isIntercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(a,c,d){return d=d||b.chain(a).map(function(a){return a.x+a.width}).max().value(),c=-1!=c?1:-1,b.sortBy(a,function(a){return c*(a.x+a.y*d)})},createStylesheet:function(a){var b=document.createElement("style");return b.setAttribute("type","text/css"),b.setAttribute("data-gs-style-id",a),b.styleSheet?b.styleSheet.cssText="":b.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(b),b.sheet},removeStylesheet:function(b){a("STYLE[data-gs-style-id="+b+"]").remove()},insertCSSRule:function(a,b,c,d){"function"==typeof a.insertRule?a.insertRule(b+"{"+c+"}",d):"function"==typeof a.addRule&&a.addRule(b,c,d)},toBool:function(a){return"boolean"==typeof a?a:"string"==typeof a?(a=a.toLowerCase(),!(""===a||"no"==a||"false"==a||"0"==a)):Boolean(a)},_collisionNodeCheck:function(a){return a!=this.node&&g.isIntercepted(a,this.nn)},_didCollide:function(a){return g.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_isAddNodeIntercepted:function(a){return g.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},a)},parseHeight:function(a){var c=a,d="px";if(c&&b.isString(c)){var e=c.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!e)throw new Error("Invalid height");d=e[2]||"px",c=parseFloat(e[1])}return{height:c,unit:d}},removePositioningStyles:function(a){var b=a[0].style;b.position&&b.removeProperty("position"),b.left&&b.removeProperty("left"),b.top&&b.removeProperty("top"),b.width&&b.removeProperty("width"),b.height&&b.removeProperty("height")}}; -// jscs:disable requireCamelCaseOrUpperCaseIdentifiers -g.is_intercepted=e(g.isIntercepted,"is_intercepted","isIntercepted"),g.create_stylesheet=e(g.createStylesheet,"create_stylesheet","createStylesheet"),g.remove_stylesheet=e(g.removeStylesheet,"remove_stylesheet","removeStylesheet"),g.insert_css_rule=e(g.insertCSSRule,"insert_css_rule","insertCSSRule"),c.registeredPlugins=[],c.registerPlugin=function(a){c.registeredPlugins.push(a)},c.prototype.resizable=function(a,b){return this},c.prototype.draggable=function(a,b){return this},c.prototype.droppable=function(a,b){return this},c.prototype.isDroppable=function(a){return!1},c.prototype.on=function(a,b,c){return this};var h=0,i=function(a,b,c,d,e){this.width=a,this["float"]=c||!1,this.height=d||0,this.nodes=e||[],this.onchange=b||function(){},this._updateCounter=0,this._float=this["float"],this._addedNodes=[],this._removedNodes=[]};i.prototype.batchUpdate=function(){this._updateCounter=1,this["float"]=!0},i.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this["float"]=this._float,this._packNodes(),this._notify())}, -// For Meteor support: https://github.com/troolee/gridstack.js/pull/272 -i.prototype.getNodeDataByDOMEl=function(a){return b.find(this.nodes,function(b){return a.get(0)===b.el.get(0)})},i.prototype._fixCollisions=function(a){this._sortNodes(-1);var c=a,d=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||d||(c={x:0,y:a.y,width:this.width,height:a.height});;){var e=b.find(this.nodes,b.bind(g._collisionNodeCheck,{node:a,nn:c}));if("undefined"==typeof e)return;this.moveNode(e,e.x,a.y+a.height,e.width,e.height,!0)}},i.prototype.isAreaEmpty=function(a,c,d,e){var f={x:a||0,y:c||0,width:d||1,height:e||1},h=b.find(this.nodes,b.bind(function(a){return g.isIntercepted(a,f)},this));return null===h||"undefined"==typeof h},i.prototype._sortNodes=function(a){this.nodes=g.sort(this.nodes,a,this.width)},i.prototype._packNodes=function(){this._sortNodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._origY&&a.y!=a._origY)for(var d=a.y;d>=a._origY;){var e=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e||(a._dirty=!0,a.y=d),--d}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var d=a.y-1,e=0===c;if(c>0){var f=b.chain(this.nodes).take(c).find(b.bind(g._didCollide,{n:a,newY:d})).value();e="undefined"==typeof f}if(!e)break;a._dirty=a.y!=d,a.y=d}},this))},i.prototype._prepareNode=function(a,c){return a=b.defaults(a||{},{width:1,height:1,x:0,y:0}),a.x=parseInt(""+a.x),a.y=parseInt(""+a.y),a.width=parseInt(""+a.width),a.height=parseInt(""+a.height),a.autoPosition=a.autoPosition||!1,a.noResize=a.noResize||!1,a.noMove=a.noMove||!1,a.width>this.width?a.width=this.width:a.width<1&&(a.width=1),a.height<1&&(a.height=1),a.x<0&&(a.x=0),a.x+a.width>this.width&&(c?a.width=this.width-a.x:a.x=this.width-a.width),a.y<0&&(a.y=0),a},i.prototype._notify=function(){var a=Array.prototype.slice.call(arguments,0);if(a[0]="undefined"==typeof a[0]?[]:[a[0]],a[1]="undefined"==typeof a[1]?!0:a[1],!this._updateCounter){var b=a[0].concat(this.getDirtyNodes());this.onchange(b,a[1])}},i.prototype.cleanNodes=function(){this._updateCounter||b.each(this.nodes,function(a){a._dirty=!1})},i.prototype.getDirtyNodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},i.prototype.addNode=function(a,c){if(a=this._prepareNode(a),"undefined"!=typeof a.maxWidth&&(a.width=Math.min(a.width,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(a.height=Math.min(a.height,a.maxHeight)),"undefined"!=typeof a.minWidth&&(a.width=Math.max(a.width,a.minWidth)),"undefined"!=typeof a.minHeight&&(a.height=Math.max(a.height,a.minHeight)),a._id=++h,a._dirty=!0,a.autoPosition){this._sortNodes();for(var d=0;;++d){var e=d%this.width,f=Math.floor(d/this.width);if(!(e+a.width>this.width||b.find(this.nodes,b.bind(g._isAddNodeIntercepted,{x:e,y:f,node:a})))){a.x=e,a.y=f;break}}}return this.nodes.push(a),"undefined"!=typeof c&&c&&this._addedNodes.push(b.clone(a)),this._fixCollisions(a),this._packNodes(),this._notify(),a},i.prototype.removeNode=function(a,c){c="undefined"==typeof c?!0:c,this._removedNodes.push(b.clone(a)),a._id=null,this.nodes=b.without(this.nodes,a),this._packNodes(),this._notify(a,c)},i.prototype.canMoveNode=function(c,d,e,f,g){if(!this.isNodeChangedPosition(c,d,e,f,g))return!1;var h=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!h)return!0;var j,k=new i(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));if("undefined"==typeof j)return!0;k.moveNode(j,d,e,f,g);var l=!0;return h&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.getGridHeight()<=this.height),l},i.prototype.canBePlacedWithRespectToHeight=function(c){if(!this.height)return!0;var d=new i(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.addNode(c),d.getGridHeight()<=this.height},i.prototype.isNodeChangedPosition=function(a,b,c,d,e){return"number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),"undefined"!=typeof a.maxWidth&&(d=Math.min(d,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(e=Math.min(e,a.maxHeight)),"undefined"!=typeof a.minWidth&&(d=Math.max(d,a.minWidth)),"undefined"!=typeof a.minHeight&&(e=Math.max(e,a.minHeight)),a.x!=b||a.y!=c||a.width!=d||a.height!=e},i.prototype.moveNode=function(a,b,c,d,e,f){if(!this.isNodeChangedPosition(a,b,c,d,e))return a;if("number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),"undefined"!=typeof a.maxWidth&&(d=Math.min(d,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(e=Math.min(e,a.maxHeight)),"undefined"!=typeof a.minWidth&&(d=Math.max(d,a.minWidth)),"undefined"!=typeof a.minHeight&&(e=Math.max(e,a.minHeight)),a.x==b&&a.y==c&&a.width==d&&a.height==e)return a;var g=a.width!=d;return a._dirty=!0,a.x=b,a.y=c,a.width=d,a.height=e,a.lastTriedX=b,a.lastTriedY=c,a.lastTriedWidth=d,a.lastTriedHeight=e,a=this._prepareNode(a,g),this._fixCollisions(a),f||(this._packNodes(),this._notify()),a},i.prototype.getGridHeight=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},i.prototype.beginUpdate=function(a){b.each(this.nodes,function(a){a._origY=a.y}),a._updating=!0},i.prototype.endUpdate=function(){b.each(this.nodes,function(a){a._origY=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var j=function(d,e){var h,j,k=this;e=e||{},this.container=a(d),"undefined"!=typeof e.handle_class&&(e.handleClass=e.handle_class,f("handle_class","handleClass")),"undefined"!=typeof e.item_class&&(e.itemClass=e.item_class,f("item_class","itemClass")),"undefined"!=typeof e.placeholder_class&&(e.placeholderClass=e.placeholder_class,f("placeholder_class","placeholderClass")),"undefined"!=typeof e.placeholder_text&&(e.placeholderText=e.placeholder_text,f("placeholder_text","placeholderText")),"undefined"!=typeof e.cell_height&&(e.cellHeight=e.cell_height,f("cell_height","cellHeight")),"undefined"!=typeof e.vertical_margin&&(e.verticalMargin=e.vertical_margin,f("vertical_margin","verticalMargin")),"undefined"!=typeof e.min_width&&(e.minWidth=e.min_width,f("min_width","minWidth")),"undefined"!=typeof e.static_grid&&(e.staticGrid=e.static_grid,f("static_grid","staticGrid")),"undefined"!=typeof e.is_nested&&(e.isNested=e.is_nested,f("is_nested","isNested")),"undefined"!=typeof e.always_show_resize_handle&&(e.alwaysShowResizeHandle=e.always_show_resize_handle,f("always_show_resize_handle","alwaysShowResizeHandle")),e.itemClass=e.itemClass||"grid-stack-item";var l=this.container.closest("."+e.itemClass).length>0;if(this.opts=b.defaults(e||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,"float":!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:b.defaults(e.resizable||{},{autoHide:!e.alwaysShowResizeHandle,handles:"se"}),draggable:b.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:e.disableDrag||!1,disableResize:e.disableResize||!1,rtl:"auto",removable:!1,removableOptions:b.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||!1,oneColumnModeClass:e.oneColumnModeClass||"grid-stack-one-column-mode",ddPlugin:null}),this.opts.ddPlugin===!1?this.opts.ddPlugin=c:null===this.opts.ddPlugin&&(this.opts.ddPlugin=b.first(c.registeredPlugins)||c),this.dd=new this.opts.ddPlugin(this),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&&this.container.addClass("grid-stack-rtl"),this.opts.isNested=l,j="auto"===this.opts.cellHeight,j?k.cellHeight(k.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),l&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new i(this.opts.width,function(a,c){c="undefined"==typeof c?!0:c;var d=0;b.each(a,function(a){c&&null===a._id?a.el&&a.el.remove():(a.el.attr("data-gs-x",a.x).attr("data-gs-y",a.y).attr("data-gs-width",a.width).attr("data-gs-height",a.height),d=Math.max(d,a.y+a.height))}),k._updateStyles(d+10)},this.opts["float"],this.opts.height),this.opts.auto){var m=[],n=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(b,c){c=a(c),m.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*n.opts.width})}),b.chain(m).sortBy(function(a){return a.i}).each(function(a){k._prepareElement(a.el)}).value()}if(this.setAnimation(this.opts.animate),this.placeholder=a('
'+this.opts.placeholderText+"
").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=b.throttle(function(){k.cellHeight(k.cellWidth(),!1)},100),this.onResizeHandler=function(){if(j&&k._updateHeightsOnResize(),k._isOneColumnMode()&&!k.opts.disableOneColumnMode){if(h)return;k.container.addClass(k.opts.oneColumnModeClass),h=!0,k.grid._sortNodes(),b.each(k.grid.nodes,function(a){k.container.append(a.el),k.opts.staticGrid||(k.dd.draggable(a.el,"disable"),k.dd.resizable(a.el,"disable"),a.el.trigger("resize"))})}else{if(!h)return;if(k.container.removeClass(k.opts.oneColumnModeClass),h=!1,k.opts.staticGrid)return;b.each(k.grid.nodes,function(a){a.noMove||k.opts.disableDrag||k.dd.draggable(a.el,"enable"),a.noResize||k.opts.disableResize||k.dd.resizable(a.el,"enable"),a.el.trigger("resize")})}},a(window).resize(this.onResizeHandler),this.onResizeHandler(),!k.opts.staticGrid&&"string"==typeof k.opts.removable){var o=a(k.opts.removable);this.dd.isDroppable(o)||this.dd.droppable(o,k.opts.removableOptions),this.dd.on(o,"dropover",function(b,c){var d=a(c.draggable),e=d.data("_gridstack_node");e._grid===k&&(d.data("inTrashZone",!0),k._setupRemovingTimeout(d))}).on(o,"dropout",function(b,c){var d=a(c.draggable),e=d.data("_gridstack_node");e._grid===k&&(d.data("inTrashZone",!1),k._clearRemovingTimeout(d))})}if(!k.opts.staticGrid&&k.opts.acceptWidgets){var p=null,q=function(a,b){var c=p,d=c.data("_gridstack_node"),e=k.getCellFromPixel({left:a.pageX,top:a.pageY},!0),f=Math.max(0,e.x),g=Math.max(0,e.y);d._added||(d._added=!0,d.el=c,d.autoPosition=!0,d.x=f,d.y=g,k.grid.cleanNodes(),k.grid.beginUpdate(d),k.grid.addNode(d),k.container.append(k.placeholder),k.placeholder.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).show(),d.el=k.placeholder,d._beforeDragX=d.x,d._beforeDragY=d.y,k._updateContainerHeight()),k.grid.canMoveNode(d,f,g)&&(k.grid.moveNode(d,f,g),k._updateContainerHeight())};this.dd.droppable(k.container,{accept:function(b){b=a(b);var c=b.data("_gridstack_node");return c&&c._grid===k?!1:b.is(k.opts.acceptWidgets===!0?".grid-stack-item":k.opts.acceptWidgets)}}).on(k.container,"dropover",function(b,c){var d=(k.container.offset(),a(c.draggable)),e=k.cellWidth(),f=k.cellHeight(),g=d.data("_gridstack_node"),h=g?g.width:Math.ceil(d.outerWidth()/e),i=g?g.height:Math.ceil(d.outerHeight()/f);p=d;var j=k.grid._prepareNode({width:h,height:i,_added:!1,_temporary:!0});d.data("_gridstack_node",j),d.data("_gridstack_node_orig",g),d.on("drag",q)}).on(k.container,"dropout",function(b,c){var d=a(c.draggable);if(d.data("_gridstack_node")){d.unbind("drag",q);var e=d.data("_gridstack_node");e.el=null,k.grid.removeNode(e),k.placeholder.detach(),k._updateContainerHeight(),d.data("_gridstack_node",d.data("_gridstack_node_orig"))}}).on(k.container,"drop",function(b,c){k.placeholder.detach();var d=a(c.draggable).data("_gridstack_node");d._grid=k;var e=a(c.draggable).clone(!1);e.data("_gridstack_node",d);var f=a(c.draggable).data("_gridstack_node_orig");"undefined"!=typeof f&&"undefined"!=typeof f._grid&&f._grid._triggerRemoveEvent(),a(c.helper).remove(),d.el=e,k.placeholder.hide(),g.removePositioningStyles(e),e.find("div.ui-resizable-handle").remove(),e.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).addClass(k.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",q),k.container.append(e),k._prepareElementsByNode(e,d),k._updateContainerHeight(),k.grid._addedNodes.push(d),k._triggerAddEvent(),k._triggerChangeEvent(),k.grid.endUpdate(),a(c.draggable).unbind("drag",q),a(c.draggable).removeData("_gridstack_node"),a(c.draggable).removeData("_gridstack_node_orig")})}}; -// jscs:disable requireCamelCaseOrUpperCaseIdentifiers -// jscs:enable requireCamelCaseOrUpperCaseIdentifiers -return j.prototype._triggerChangeEvent=function(a){var b=this.grid.getDirtyNodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},j.prototype._triggerAddEvent=function(){this.grid._addedNodes&&this.grid._addedNodes.length>0&&(this.container.trigger("added",[b.map(this.grid._addedNodes,b.clone)]),this.grid._addedNodes=[])},j.prototype._triggerRemoveEvent=function(){this.grid._removedNodes&&this.grid._removedNodes.length>0&&(this.container.trigger("removed",[b.map(this.grid._removedNodes,b.clone)]),this.grid._removedNodes=[])},j.prototype._initStyles=function(){this._stylesId&&g.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=g.createStylesheet(this._stylesId),null!==this._styles&&(this._styles._max=0)},j.prototype._updateStyles=function(a){if(null!==this._styles&&"undefined"!=typeof this._styles){var b,c="."+this.opts._class+" ."+this.opts.itemClass,d=this;if("undefined"==typeof a&&(a=this._styles._max),!(0!==this._styles._max&&a<=this._styles._max)&&(this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&(b=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(a,b){return a&&b?"calc("+(d.opts.cellHeight*a+d.opts.cellHeightUnit)+" + "+(d.opts.verticalMargin*b+d.opts.verticalMarginUnit)+")":d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit}:function(a,b){return d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit},0===this._styles._max&&g.insertCSSRule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max))){for(var e=this._styles._max;a>e;++e)g.insertCSSRule(this._styles,c+'[data-gs-height="'+(e+1)+'"]',"height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-min-height="'+(e+1)+'"]',"min-height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-max-height="'+(e+1)+'"]',"max-height: "+b(e+1,e)+";",e),g.insertCSSRule(this._styles,c+'[data-gs-y="'+e+'"]',"top: "+b(e,e)+";",e);this._styles._max=a}}},j.prototype._updateContainerHeight=function(){if(!this.grid._updateCounter){var a=this.grid.getGridHeight(),b=parseInt(this.container.css("min-height"))/this.cellHeight();b>a&&(a=b),this.container.attr("data-gs-current-height",a),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.container.css("height",a*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.container.css("height","calc("+(a*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(a*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.container.css("height",a*this.opts.cellHeight+this.opts.cellHeightUnit))}},j.prototype._isOneColumnMode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.minWidth},j.prototype._setupRemovingTimeout=function(b){var c=this,d=a(b).data("_gridstack_node");!d._removeTimeout&&c.opts.removable&&(d._removeTimeout=setTimeout(function(){b.addClass("grid-stack-item-removing"),d._isAboutToRemove=!0},c.opts.removeTimeout))},j.prototype._clearRemovingTimeout=function(b){var c=a(b).data("_gridstack_node");c._removeTimeout&&(clearTimeout(c._removeTimeout),c._removeTimeout=null,b.removeClass("grid-stack-item-removing"),c._isAboutToRemove=!1)},j.prototype._prepareElementsByNode=function(b,c){var d,e,f=this,h=function(a,g){var h,i,j=Math.round(g.position.left/d),k=Math.floor((g.position.top+e/2)/e);if("drag"!=a.type&&(h=Math.round(g.size.width/d),i=Math.round(g.size.height/e)),"drag"==a.type)b.data("inTrashZone")||0>j||j>=f.grid.width||0>k||!f.grid["float"]&&k>f.grid.getGridHeight()?c._temporaryRemoved||(f.opts.removable===!0&&f._setupRemovingTimeout(b),j=c._beforeDragX,k=c._beforeDragY,f.placeholder.detach(),f.placeholder.hide(),f.grid.removeNode(c),f._updateContainerHeight(),c._temporaryRemoved=!0):(f._clearRemovingTimeout(b),c._temporaryRemoved&&(f.grid.addNode(c),f.placeholder.attr("data-gs-x",j).attr("data-gs-y",k).attr("data-gs-width",h).attr("data-gs-height",i).show(),f.container.append(f.placeholder),c.el=f.placeholder,c._temporaryRemoved=!1));else if("resize"==a.type&&0>j)return; -// width and height are undefined if not resizing -var l="undefined"!=typeof h?h:c.lastTriedWidth,m="undefined"!=typeof i?i:c.lastTriedHeight;!f.grid.canMoveNode(c,j,k,h,i)||c.lastTriedX===j&&c.lastTriedY===k&&c.lastTriedWidth===l&&c.lastTriedHeight===m||(c.lastTriedX=j,c.lastTriedY=k,c.lastTriedWidth=h,c.lastTriedHeight=i,f.grid.moveNode(c,j,k,h,i),f._updateContainerHeight())},i=function(g,h){f.container.append(f.placeholder);var i=a(this);f.grid.cleanNodes(),f.grid.beginUpdate(c),d=f.cellWidth();var j=Math.ceil(i.outerHeight()/i.attr("data-gs-height"));e=f.container.height()/parseInt(f.container.attr("data-gs-current-height")),f.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),c.el=f.placeholder,c._beforeDragX=c.x,c._beforeDragY=c.y,f.dd.resizable(b,"option","minWidth",d*(c.minWidth||1)),f.dd.resizable(b,"option","minHeight",j*(c.minHeight||1)),"resizestart"==g.type&&i.find(".grid-stack-item").trigger("resizestart")},j=function(d,e){var h=a(this);if(h.data("_gridstack_node")){var i=!1;if(f.placeholder.detach(),c.el=h,f.placeholder.hide(),c._isAboutToRemove){i=!0;var j=b.data("_gridstack_node")._grid;j._triggerRemoveEvent(),b.removeData("_gridstack_node"),b.remove()}else f._clearRemovingTimeout(b),c._temporaryRemoved?(g.removePositioningStyles(h),h.attr("data-gs-x",c._beforeDragX).attr("data-gs-y",c._beforeDragY).attr("data-gs-width",c.width).attr("data-gs-height",c.height),c.x=c._beforeDragX,c.y=c._beforeDragY,f.grid.addNode(c)):(g.removePositioningStyles(h),h.attr("data-gs-x",c.x).attr("data-gs-y",c.y).attr("data-gs-width",c.width).attr("data-gs-height",c.height));f._updateContainerHeight(),f._triggerChangeEvent(i),f.grid.endUpdate();var k=h.find(".grid-stack");k.length&&"resizestop"==d.type&&(k.each(function(b,c){a(c).data("gridstack").onResizeHandler()}),h.find(".grid-stack-item").trigger("resizestop"),h.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"==d.type&&f.container.trigger("gsresizestop",h)}};this.dd.draggable(b,{start:i,stop:j,drag:h}).resizable(b,{start:i,stop:j,resize:h}),(c.noMove||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(b,"disable"),(c.noResize||this._isOneColumnMode()&&!f.opts.disableOneColumnMode||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(b,"disable"),b.attr("data-gs-locked",c.locked?"yes":null)},j.prototype._prepareElement=function(b,c){c="undefined"!=typeof c?c:!1;var d=this;b=a(b),b.addClass(this.opts.itemClass);var e=d.grid.addNode({x:b.attr("data-gs-x"),y:b.attr("data-gs-y"),width:b.attr("data-gs-width"),height:b.attr("data-gs-height"),maxWidth:b.attr("data-gs-max-width"),minWidth:b.attr("data-gs-min-width"),maxHeight:b.attr("data-gs-max-height"),minHeight:b.attr("data-gs-min-height"),autoPosition:g.toBool(b.attr("data-gs-auto-position")),noResize:g.toBool(b.attr("data-gs-no-resize")),noMove:g.toBool(b.attr("data-gs-no-move")),locked:g.toBool(b.attr("data-gs-locked")),resizeHandles:b.attr("data-gs-resize-handles"),el:b,id:b.attr("data-gs-id"),_grid:d},c);b.data("_gridstack_node",e),this._prepareElementsByNode(b,e)},j.prototype.setAnimation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},j.prototype.addWidget=function(b,c,d,e,f,g,h,i,j,k,l){return b=a(b),"undefined"!=typeof c&&b.attr("data-gs-x",c),"undefined"!=typeof d&&b.attr("data-gs-y",d),"undefined"!=typeof e&&b.attr("data-gs-width",e),"undefined"!=typeof f&&b.attr("data-gs-height",f),"undefined"!=typeof g&&b.attr("data-gs-auto-position",g?"yes":null),"undefined"!=typeof h&&b.attr("data-gs-min-width",h),"undefined"!=typeof i&&b.attr("data-gs-max-width",i),"undefined"!=typeof j&&b.attr("data-gs-min-height",j),"undefined"!=typeof k&&b.attr("data-gs-max-height",k),"undefined"!=typeof l&&b.attr("data-gs-id",l),this.container.append(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.makeWidget=function(b){return b=a(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},j.prototype.willItFit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,autoPosition:e};return this.grid.canBePlacedWithRespectToHeight(f)},j.prototype.removeWidget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node"); -// For Meteor support: https://github.com/troolee/gridstack.js/pull/272 -d||(d=this.grid.getNodeDataByDOMEl(b)),this.grid.removeNode(d,c),b.removeData("_gridstack_node"),this._updateContainerHeight(),c&&b.remove(),this._triggerChangeEvent(!0),this._triggerRemoveEvent()},j.prototype.removeAll=function(a){b.each(this.grid.nodes,b.bind(function(b){this.removeWidget(b.el,a)},this)),this.grid.nodes=[],this._updateContainerHeight()},j.prototype.destroy=function(b){a(window).off("resize",this.onResizeHandler),this.disable(),"undefined"==typeof b||b?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),g.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},j.prototype.resizable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");"undefined"!=typeof f&&null!==f&&(f.noResize=!c,f.noResize||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?d.dd.resizable(e,"disable"):d.dd.resizable(e,"enable"))}),this},j.prototype.movable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");"undefined"!=typeof f&&null!==f&&(f.noMove=!c,f.noMove||d._isOneColumnMode()&&!d.opts.disableOneColumnMode?(d.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(d.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},j.prototype.enableMove=function(a,b){this.movable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableDrag=!a)},j.prototype.enableResize=function(a,b){this.resizable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableResize=!a)},j.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},j.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},j.prototype.locked=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(e.locked=c||!1,d.attr("data-gs-locked",e.locked?"yes":null))}),this},j.prototype.maxHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.maxHeight=c||!1,d.attr("data-gs-max-height",c)))}),this},j.prototype.minHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.minHeight=c||!1,d.attr("data-gs-min-height",c)))}),this},j.prototype.maxWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.maxWidth=c||!1,d.attr("data-gs-max-width",c)))}),this},j.prototype.minWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.minWidth=c||!1,d.attr("data-gs-min-width",c)))}),this},j.prototype._updateElement=function(b,c){b=a(b).first();var d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!==d){var e=this;e.grid.cleanNodes(),e.grid.beginUpdate(d),c.call(this,b,d),e._updateContainerHeight(),e._triggerChangeEvent(),e.grid.endUpdate()}},j.prototype.resize=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.width,c=null!==c&&"undefined"!=typeof c?c:d.height,this.grid.moveNode(d,d.x,d.y,b,c)})},j.prototype.move=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.x,c=null!==c&&"undefined"!=typeof c?c:d.y,this.grid.moveNode(d,b,c,d.width,d.height)})},j.prototype.update=function(a,b,c,d,e){this._updateElement(a,function(a,f){b=null!==b&&"undefined"!=typeof b?b:f.x,c=null!==c&&"undefined"!=typeof c?c:f.y,d=null!==d&&"undefined"!=typeof d?d:f.width,e=null!==e&&"undefined"!=typeof e?e:f.height,this.grid.moveNode(f,b,c,d,e)})},j.prototype.verticalMargin=function(a,b){if("undefined"==typeof a)return this.opts.verticalMargin;var c=g.parseHeight(a);this.opts.verticalMarginUnit===c.unit&&this.opts.height===c.height||(this.opts.verticalMarginUnit=c.unit,this.opts.verticalMargin=c.height,b||this._updateStyles())},j.prototype.cellHeight=function(a,b){if("undefined"==typeof a){if(this.opts.cellHeight)return this.opts.cellHeight;var c=this.container.children("."+this.opts.itemClass).first();return Math.ceil(c.outerHeight()/c.attr("data-gs-height"))}var d=g.parseHeight(a);this.opts.cellHeightUnit===d.heightUnit&&this.opts.height===d.height||(this.opts.cellHeightUnit=d.unit,this.opts.cellHeight=d.height,b||this._updateStyles())},j.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.width)},j.prototype.getCellFromPixel=function(a,b){var c="undefined"!=typeof b&&b?this.container.offset():this.container.position(),d=a.left-c.left,e=a.top-c.top,f=Math.floor(this.container.width()/this.opts.width),g=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(d/f),y:Math.floor(e/g)}},j.prototype.batchUpdate=function(){this.grid.batchUpdate()},j.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},j.prototype.isAreaEmpty=function(a,b,c,d){return this.grid.isAreaEmpty(a,b,c,d)},j.prototype.setStatic=function(a){this.opts.staticGrid=a===!0,this.enableMove(!a),this.enableResize(!a),this._setStaticClass()},j.prototype._setStaticClass=function(){var a="grid-stack-static";this.opts.staticGrid===!0?this.container.addClass(a):this.container.removeClass(a)},j.prototype._updateNodeWidths=function(a,b){this.grid._sortNodes(),this.grid.batchUpdate();for(var c={},d=0;d Date: Thu, 14 Sep 2017 09:01:13 -0700 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afa0a12df..8fac028e8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "git+https://github.com/gridstack/gridstack.js.git" }, "scripts": { - "build": "mkdir dist && grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md", + "build": "grunt && doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md", "test": "grunt lint && karma start karma.conf.js", "lint": "grunt lint", "reset": "rm -rf node_modules dist"