Compare commits
429 commits
Author | SHA1 | Date | |
---|---|---|---|
c1c4ff8e92 | |||
ff547b5ba0 | |||
b0e68cafca | |||
9007eeafe7 | |||
6d5f189613 | |||
016c1610bc | |||
bd8bbfff2a | |||
4383fc846d | |||
2f2c6bbaf4 | |||
5cf92a3c62 | |||
215a6f16a2 | |||
8a554b37c5 | |||
8dc5916896 | |||
79d9b423ce | |||
0102470f65 | |||
6ebd7a2005 | |||
ca95e7ba49 | |||
6e4c6d2645 | |||
a749a930c0 | |||
999020bcff | |||
5bc7d51959 | |||
6ca195271f | |||
46b857a443 | |||
6122ca4d27 | |||
e9460847ce | |||
56d9ec325d | |||
bc4d07687a | |||
625a8378b4 | |||
a9a332cd8f | |||
3f193dbb3a | |||
7cb3da3878 | |||
6d8ce2299c | |||
eeff06dbe8 | |||
0b3b47cefe | |||
67dc2dd85c | |||
64ea5c4cf6 | |||
78f00738ab | |||
30b096d5f9 | |||
01a27c6ed9 | |||
f1cdbe27c9 | |||
af0f2d235b | |||
76164595fe | |||
f8b56af17b | |||
d3db46a3a5 | |||
a219accfa3 | |||
075c06f38e | |||
39ffe9ca3d | |||
eebc0b15a6 | |||
5c605e48b7 | |||
28ed6fa374 | |||
a064a2ee6b | |||
3928d05109 | |||
0d7c8edc92 | |||
4ae4540bba | |||
12605cceeb | |||
8f072be871 | |||
75e936314b | |||
5c4e44ef23 | |||
9c0bcd74e7 | |||
042ba6a887 | |||
ceaffa8f54 | |||
723cb235b9 | |||
137fe18995 | |||
ceef60d356 | |||
07ff68010e | |||
fcd2327194 | |||
703c52dc59 | |||
d47ad9cd21 | |||
11b6292d31 | |||
b09ae61fe2 | |||
696b0f7ca8 | |||
56801119c2 | |||
a04a247743 | |||
34213e6fe9 | |||
dbe642f294 | |||
491388379c | |||
0c424c2637 | |||
c0704f18d4 | |||
1079cd4c1c | |||
5498ce2bae | |||
669c6747f2 | |||
cb7e0bdeb4 | |||
7f1d362a29 | |||
62f07b2da1 | |||
2de0c4ee00 | |||
020523855e | |||
9cc4396f2e | |||
d909458602 | |||
8f69732dda | |||
d3b77baf8c | |||
f29236a78f | |||
6579b4c93d | |||
8c240d1e83 | |||
cabb0b886a | |||
8ea6b706ba | |||
47fbdd1ff3 | |||
9a9e8ece7e | |||
d7a4171b54 | |||
4c3abe8e63 | |||
fb157a3dd2 | |||
0336d2401e | |||
f0c76130e7 | |||
9fecc0dcb5 | |||
69ebbdbae5 | |||
c9971a69a4 | |||
99653bded3 | |||
acaec8d429 | |||
35b9c6a6c2 | |||
4399e1a455 | |||
94b249c77d | |||
0a5d67cfc8 | |||
f20fb331c9 | |||
cad14ab88e | |||
61ed99ab5c | |||
0c409773a7 | |||
cc9271bcb5 | |||
08f8b1d118 | |||
2c71ce639c | |||
f04965a78e | |||
90838740b0 | |||
7b1f147283 | |||
0c0b7793dd | |||
fa9736ee84 | |||
0318e3a922 | |||
2f29a71c8f | |||
d06834c5cc | |||
01c7607d0b | |||
8a419fbda7 | |||
c93ff95c03 | |||
19a52197c2 | |||
a3babd353c | |||
376a5f2945 | |||
61fc120b11 | |||
93bedb4404 | |||
373c1eab14 | |||
92d7e51d68 | |||
e4fecff7f7 | |||
208a8baf64 | |||
e2b88ec0d9 | |||
de83c6230b | |||
4862a61af3 | |||
205df5ded4 | |||
3d19aede54 | |||
398dccb7a9 | |||
1dd2420207 | |||
3d0c8baefe | |||
620d190ba9 | |||
7f0d4921a5 | |||
f29a34aaea | |||
0273bb66d8 | |||
c14473fab1 | |||
6cd56abe11 | |||
2ddd6d5adb | |||
0b944927ab | |||
50607a9797 | |||
156b8e40cb | |||
ff0c00bc34 | |||
3ecc1caab9 | |||
aa18c6332e | |||
b3d5be137c | |||
601b5d54a3 | |||
65d5110349 | |||
ea442d1936 | |||
d010ddd93e | |||
50ce614128 | |||
c309856f8d | |||
3d8a8e1e42 | |||
446dade5d0 | |||
d20f6703c6 | |||
0816163693 | |||
e31d50eedc | |||
67274f873c | |||
ba1ee253bb | |||
eedf6d5716 | |||
6aae19b80d | |||
51d7a20116 | |||
b9c916554e | |||
4af1f27447 | |||
f96dae55f3 | |||
d521ef5330 | |||
19f41a72a8 | |||
1c040b7e0b | |||
bc62227717 | |||
735ffa2129 | |||
e1602ed658 | |||
8faecc9176 | |||
a053998899 | |||
e1d8c736b8 | |||
f447890421 | |||
3e78afceb5 | |||
9d12e25a02 | |||
68ebd3e5a5 | |||
a51a802268 | |||
5a427dd6bd | |||
b44308b4ed | |||
cac983e2af | |||
b41dfe062c | |||
91757911fa | |||
ab6df29429 | |||
32dcc4725c | |||
e34407d40c | |||
2abfbb37bf | |||
3f374257f2 | |||
a33f046fa6 | |||
00d780adfa | |||
6cd5084a23 | |||
eca0e9f9bd | |||
88e3c1d8e5 | |||
85740de2e0 | |||
54b2b9105e | |||
fba9bd52db | |||
9c01f02f1a | |||
907464c891 | |||
707916d6da | |||
23cd18804a | |||
cddbf077be | |||
9e8d5c3203 | |||
9168a7fc51 | |||
41f1b5c42a | |||
2247a361c2 | |||
d915030cd6 | |||
8a7bbd76c7 | |||
464a8e8982 | |||
698fce3ac4 | |||
f990b71464 | |||
fcae35661f | |||
42bb51b876 | |||
acdd8b9100 | |||
98d1e301f0 | |||
9d269e18f2 | |||
934863e285 | |||
1c4738084a | |||
78058d9cbe | |||
c02c2a36d1 | |||
5f5a83d01b | |||
43c400db8c | |||
ae95373f79 | |||
78803147c6 | |||
1039368121 | |||
b67ac87f7d | |||
de26b00f85 | |||
d1c90cf3d7 | |||
9d80ede0b9 | |||
1c67f7d6d7 | |||
2075d2556b | |||
a5d06d2b1f | |||
4feab20cdf | |||
6954d2c9b7 | |||
d3dcb6b61b | |||
715d972a4f | |||
ba086c7c0a | |||
ab9b8eb78c | |||
9b455d6018 | |||
308a33bb45 | |||
af17294971 | |||
4b7cc8d24b | |||
07fd836de6 | |||
c185a7a093 | |||
72432d0fa8 | |||
c34777b2a0 | |||
ce2cd06c01 | |||
3a5c675e6f | |||
c4f30b3df1 | |||
ce47d340d2 | |||
049ef64c51 | |||
495918f9c7 | |||
e09b0c9a30 | |||
4b13d407b0 | |||
76f90a21f3 | |||
9b531d0571 | |||
cea9174bd3 | |||
632c3e14c2 | |||
781776e408 | |||
2e4964d675 | |||
15192f33bd | |||
100860d262 | |||
7c586417fb | |||
c43a12ac06 | |||
47218bd7a6 | |||
e52d16defa | |||
d3d00d563f | |||
504b0ad4ac | |||
b8bd181970 | |||
f5311ec8d0 | |||
56b4c7f12c | |||
b9b52603e8 | |||
eca0ce7335 | |||
0202fa9257 | |||
ff15070de0 | |||
bb0ce8fab1 | |||
47817a3489 | |||
03ca75717c | |||
1364e180e1 | |||
ca800454f1 | |||
a830cc51d0 | |||
6e0aab4780 | |||
b979982cc5 | |||
ed8a673022 | |||
71c15ee64c | |||
331eef1f57 | |||
9c51fa040f | |||
a4540dc118 | |||
fe865db460 | |||
02f0eba64d | |||
29857f4131 | |||
45d39a0b3a | |||
1527485f75 | |||
31c3eb494e | |||
f163d40e7f | |||
e146e0d943 | |||
a654096a39 | |||
f9aafafb8f | |||
ab08669965 | |||
7bcbeba849 | |||
64de4684e3 | |||
12e3d5f8ec | |||
2bb81a7085 | |||
b968bb3501 | |||
cc284c735f | |||
1cce0bd9f6 | |||
e9bc1bb3ad | |||
707ab11f54 | |||
0be3e4d1df | |||
1e75be19ed | |||
f4e8b9e03e | |||
1edda7f24c | |||
f34e93baac | |||
ef9328fdab | |||
01e213a8e5 | |||
18ee70a2af | |||
5ce3c17039 | |||
e85081b9d7 | |||
48ad1afd3b | |||
cfb0dfc345 | |||
ca594a6ba2 | |||
dd4447920f | |||
6433bfb9fc | |||
8b1f180135 | |||
96b84ed45b | |||
acc2acbec1 | |||
8ebb3f74b4 | |||
90424c0d8a | |||
d42b8c79e4 | |||
c90730516e | |||
d11eaba9b8 | |||
aff5ce5204 | |||
928d9d3679 | |||
44ed26d813 | |||
deff21d822 | |||
8314837213 | |||
6017f346f8 | |||
7a76830272 | |||
8410c3babf | |||
9bb409fdee | |||
3fb6c55334 | |||
4dae65aa46 | |||
f1e9723484 | |||
c679b26d02 | |||
15a121e7d6 | |||
652979a3f8 | |||
b32b3f251f | |||
195fa60ecb | |||
81e6351586 | |||
64aa4734cc | |||
7c7fd5ae0a | |||
9237ae7fb7 | |||
48e96cd746 | |||
7c8c08e101 | |||
83ac5af45f | |||
1fe90ee79b | |||
61a129e77c | |||
9c644eef98 | |||
bce1eeaf06 | |||
4471b9e385 | |||
9bba3fbb18 | |||
71e2f3da86 | |||
912662bbbb | |||
8c5ab67796 | |||
816071a077 | |||
bee6ff6e31 | |||
fc571d8b82 | |||
922cc30ea7 | |||
3be2105a93 | |||
b7c7b3b8f3 | |||
5472f95252 | |||
c2b1dee5fa | |||
77159bfbe1 | |||
7cc527149b | |||
fbe4113ea8 | |||
b00114d5bc | |||
847a54c492 | |||
79f509c6e6 | |||
91e9d6fb77 | |||
bbf1644f3f | |||
54e8e60c28 | |||
d317455ba2 | |||
798c5c429f | |||
1b3a0cbf89 | |||
8848249035 | |||
9442e3cd7e | |||
69d2df188d | |||
4a80e41811 | |||
feab5d8e18 | |||
5e06c68e98 | |||
5bbd8d5f54 | |||
f7e041586f | |||
d26a079d43 | |||
510a575714 | |||
c35042dbc4 | |||
a349b76156 | |||
e0e9eec66f | |||
7f0d622e71 | |||
187e13a244 | |||
ed29eed4a0 | |||
ac219ab2ea | |||
c35a3cad1d | |||
a738ee8e52 | |||
177ddc10c3 | |||
cbb0c28a4e | |||
5b73939bc4 | |||
0a58260563 | |||
c162173e87 | |||
2349443938 | |||
6ffdf307f8 | |||
14f319e9dc | |||
71f86dd3af | |||
3de2fc680c | |||
231bc8ce65 | |||
ce9d97885a |
15
.bithoundrc
Normal file
15
.bithoundrc
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"ignore": [
|
||||
"dist/**",
|
||||
"**/node_modules/**",
|
||||
"**/bower_components/**",
|
||||
"**/demo/**",
|
||||
"**/coverage/**"
|
||||
],
|
||||
"test": [
|
||||
"**/spec/**"
|
||||
],
|
||||
"critics": {
|
||||
"lint": "jshint"
|
||||
}
|
||||
}
|
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
node_modules
|
||||
bower_components
|
||||
coverage
|
||||
*.log
|
19
.jscsrc
Normal file
19
.jscsrc
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"preset": "node-style-guide",
|
||||
"validateIndentation": 4,
|
||||
"maximumLineLength": 120,
|
||||
"jsDoc": {
|
||||
"checkAnnotations": {
|
||||
"preset": "jsdoc3",
|
||||
"extra": {
|
||||
"preserve": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"validateLineBreaks": false,
|
||||
"requireTrailingComma": false,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"requireCapitalizedComments": false,
|
||||
"excludeFiles": ["dist/*.js", "demo/*", "spec/*"]
|
||||
}
|
31
.travis.yml
Normal file
31
.travis.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- 5.7.0
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
before_install:
|
||||
- npm install -g protractor
|
||||
install:
|
||||
- npm install -g npm@2
|
||||
- npm install -g grunt-cli
|
||||
- npm install -g bower
|
||||
- bower install
|
||||
- npm install
|
||||
- ./node_modules/protractor/bin/webdriver-manager update --standalone
|
||||
before_script:
|
||||
- export CHROME_BIN=chromium-browser
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
script:
|
||||
- npm run build
|
||||
- npm test
|
||||
- grunt e2e-test
|
||||
notifications:
|
||||
slack:
|
||||
secure: iGLGsYyVIyKVpVVCskGh/zc6Pkqe0D7jpUtbywSbnq6l5seE6bvBVqm0F2FSCIN+AIC+qal2mPEWysDVsLACm5tTEeA8NfL8dmCrAKbiFbi+gHl4mnHHCHl7ii/7UkoIIXNc5UXbgMSXRS5l8UcsSDlN8VxC5zWstbJvjeYIvbA=
|
139
Gruntfile.js
Normal file
139
Gruntfile.js
Normal file
|
@ -0,0 +1,139 @@
|
|||
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
|
||||
module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-sass');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-doctoc');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-jscs');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-protractor-runner');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-protractor-webdriver');
|
||||
|
||||
grunt.initConfig({
|
||||
sass: {
|
||||
options: {
|
||||
outputStyle: 'expanded'
|
||||
},
|
||||
dist: {
|
||||
files: {
|
||||
'dist/gridstack.css': 'src/gridstack.scss',
|
||||
'dist/gridstack-extra.css': 'src/gridstack-extra.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
cssmin: {
|
||||
dist: {
|
||||
files: {
|
||||
'dist/gridstack.min.css': ['dist/gridstack.css'],
|
||||
'dist/gridstack-extra.min.css': ['dist/gridstack-extra.css']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
copy: {
|
||||
dist: {
|
||||
files: {
|
||||
'dist/gridstack.js': ['src/gridstack.js'],
|
||||
'dist/gridstack.jQueryUI.js': ['src/gridstack.jQueryUI.js'],
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
sourceMapName: 'dist/gridstack.min.map',
|
||||
preserveComments: 'some'
|
||||
},
|
||||
dist: {
|
||||
files: {
|
||||
'dist/gridstack.min.js': ['src/gridstack.js'],
|
||||
'dist/gridstack.jQueryUI.min.js': ['src/gridstack.jQueryUI.js'],
|
||||
'dist/gridstack.all.js': ['src/gridstack.js', 'src/gridstack.jQueryUI.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
doctoc: {
|
||||
options: {
|
||||
removeAd: false
|
||||
},
|
||||
readme: {
|
||||
options: {
|
||||
target: './README.md'
|
||||
}
|
||||
},
|
||||
doc: {
|
||||
options: {
|
||||
target: './doc/README.md'
|
||||
}
|
||||
},
|
||||
faq: {
|
||||
options: {
|
||||
target: './doc/FAQ.md'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
jshint: {
|
||||
all: ['src/*.js']
|
||||
},
|
||||
|
||||
jscs: {
|
||||
all: ['*.js', 'src/*.js', ],
|
||||
},
|
||||
|
||||
watch: {
|
||||
scripts: {
|
||||
files: ['src/*.js'],
|
||||
tasks: ['uglify', 'copy'],
|
||||
options: {
|
||||
},
|
||||
},
|
||||
styles: {
|
||||
files: ['src/*.scss'],
|
||||
tasks: ['sass', 'cssmin'],
|
||||
options: {
|
||||
},
|
||||
},
|
||||
docs: {
|
||||
files: ['README.md', 'doc/README.md', 'doc/FAQ.md'],
|
||||
tasks: ['doctoc'],
|
||||
options: {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
protractor: {
|
||||
options: {
|
||||
configFile: 'protractor.conf.js',
|
||||
},
|
||||
all: {}
|
||||
},
|
||||
|
||||
connect: {
|
||||
all: {
|
||||
options: {
|
||||
port: 8080,
|
||||
hostname: 'localhost',
|
||||
base: '.',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
protractor_webdriver: {
|
||||
all: {
|
||||
options: {
|
||||
command: 'webdriver-manager start',
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('default', ['sass', 'cssmin', 'jshint', 'jscs', 'copy', 'uglify', 'doctoc']);
|
||||
grunt.registerTask('e2e-test', ['connect', 'protractor_webdriver', 'protractor']);
|
||||
};
|
3
LICENSE
3
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015 Pavel Reznikov
|
||||
Copyright (c) 2014-2016 Pavel Reznikov, Dylan Weiss
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
|
516
README.md
516
README.md
|
@ -1,53 +1,39 @@
|
|||
gridstack.js
|
||||
============
|
||||
|
||||
gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build
|
||||
draggable responsive bootstrap v3 friendly layouts. It also works great with [knockout.js](http://knockoutjs.com) and
|
||||
touch devices.
|
||||
[![Build Status](https://travis-ci.org/troolee/gridstack.js.svg?branch=master)](https://travis-ci.org/troolee/gridstack.js)
|
||||
[![Coverage Status](https://coveralls.io/repos/github/troolee/gridstack.js/badge.svg?branch=master)](https://coveralls.io/github/troolee/gridstack.js?branch=master)
|
||||
[![Dependency Status](https://david-dm.org/troolee/gridstack.js.svg)](https://david-dm.org/troolee/gridstack.js)
|
||||
[![devDependency Status](https://david-dm.org/troolee/gridstack.js/dev-status.svg)](https://david-dm.org/troolee/gridstack.js#info=devDependencies)
|
||||
[![Stories in Ready](https://badge.waffle.io/troolee/gridstack.js.png?label=ready&title=Ready)](http://waffle.io/troolee/gridstack.js)
|
||||
|
||||
Inspired by [gridster.js](http://gridster.net). Built with love.
|
||||
gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build
|
||||
draggable responsive bootstrap v3 friendly layouts. It also works great with [knockout.js](http://knockoutjs.com), [angular.js](https://angularjs.org) and touch devices.
|
||||
|
||||
Inspired by [gridster.js](https://github.com/ducksboard/gridster.js). Built with love.
|
||||
|
||||
Join gridstack.js on Slack: https://gridstackjs.troolee.com
|
||||
|
||||
[![Slack Status](https://gridstackjs.troolee.com/badge.svg)](https://gridstackjs.troolee.com)
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
|
||||
|
||||
- [Demo](#demo)
|
||||
- [Usage](#usage)
|
||||
- [Requirements](#requirements)
|
||||
- [Using gridstack.js with jQuery UI](#using-gridstackjs-with-jquery-ui)
|
||||
- [Install](#install)
|
||||
- [Basic usage](#basic-usage)
|
||||
- [Options](#options)
|
||||
- [Grid attributes](#grid-attributes)
|
||||
- [Item attributes](#item-attributes)
|
||||
- [Events](#events)
|
||||
- [onchange(items)](#onchangeitems)
|
||||
- [ondragstart(event, ui)](#ondragstartevent-ui)
|
||||
- [ondragstop(event, ui)](#ondragstopevent-ui)
|
||||
- [onresizestart(event, ui)](#onresizestartevent-ui)
|
||||
- [onresizestop(event, ui)](#onresizestopevent-ui)
|
||||
- [API](#api)
|
||||
- [add_widget(el, x, y, width, height, auto_position)](#add_widgetel-x-y-width-height-auto_position)
|
||||
- [batch_update()](#batch_update)
|
||||
- [cell_height()](#cell_height)
|
||||
- [cell_height(val)](#cell_heightval)
|
||||
- [cell_width()](#cell_width)
|
||||
- [commit()](#commit)
|
||||
- [disable()](#disable)
|
||||
- [enable()](#enable)
|
||||
- [get_cell_from_pixel(position)](#get_cell_from_pixelposition)
|
||||
- [is_area_empty(x, y, width, height)](#is_area_emptyx-y-width-height)
|
||||
- [locked(el, val)](#lockedel-val)
|
||||
- [remove_widget(el, detach_node)](#remove_widgetel-detach_node)
|
||||
- [remove_all()](#remove_all)
|
||||
- [resize(el, width, height)](#resizeel-width-height)
|
||||
- [move(el, x, y)](#moveel-x-y)
|
||||
- [resizable(el, val)](#resizableel-val)
|
||||
- [movable(el, val)](#movableel-val)
|
||||
- [update(el, x, y, width, height)](#updateel-x-y-width-height)
|
||||
- [will_it_fit(x, y, width, height, auto_position)](#will_it_fitx-y-width-height-auto_position)
|
||||
- [Utils](#utils)
|
||||
- [GridStackUI.Utils.sort(nodes, dir, width)](#gridstackuiutilssortnodes-dir-width)
|
||||
- [Migrating to v0.3.0](#migrating-to-v030)
|
||||
- [Migrating to v0.2.5](#migrating-to-v025)
|
||||
- [API Documentation](#api-documentation)
|
||||
- [Questions and Answers](#questions-and-answers)
|
||||
- [Touch devices support](#touch-devices-support)
|
||||
- [Use with knockout.js](#use-with-knockoutjs)
|
||||
- [Use with angular.js](#use-with-angularjs)
|
||||
- [Rails integration](#rails-integration)
|
||||
- [Change grid width](#change-grid-width)
|
||||
- [Extra CSS](#extra-css)
|
||||
- [Different grid widths](#different-grid-widths)
|
||||
|
@ -55,9 +41,17 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
|
|||
- [Load grid from array](#load-grid-from-array)
|
||||
- [Override resizable/draggable options](#override-resizabledraggable-options)
|
||||
- [IE8 support](#ie8-support)
|
||||
- [Use with require.js](#use-with-requirejs)
|
||||
- [Nested grids](#nested-grids)
|
||||
- [Resizing active grid](#resizing-active-grid)
|
||||
- [Using AniJS](#using-anijs)
|
||||
- [The Team](#the-team)
|
||||
- [Changes](#changes)
|
||||
- [v0.2.3 (development version)](#v023-development-version)
|
||||
- [v0.3.0-dev (Development Version)](#v030-dev-development-version)
|
||||
- [v0.2.6 (2016-08-17)](#v026-2016-08-17)
|
||||
- [v0.2.5 (2016-03-02)](#v025-2016-03-02)
|
||||
- [v0.2.4 (2016-02-15)](#v024-2016-02-15)
|
||||
- [v0.2.3 (2015-06-23)](#v023-2015-06-23)
|
||||
- [v0.2.2 (2014-12-23)](#v022-2014-12-23)
|
||||
- [v0.2.1 (2014-12-09)](#v021-2014-12-09)
|
||||
- [v0.2.0 (2014-11-30)](#v020-2014-11-30)
|
||||
|
@ -70,7 +64,7 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
|
|||
Demo
|
||||
====
|
||||
|
||||
Please visit http://troolee.github.io/gridstack.js/ for demo.
|
||||
Please visit http://troolee.github.io/gridstack.js/ for demo. Or check out [these example](http://troolee.github.io/gridstack.js/demo/).
|
||||
|
||||
|
||||
Usage
|
||||
|
@ -78,25 +72,58 @@ Usage
|
|||
|
||||
## Requirements
|
||||
|
||||
* [lodash.js](https://lodash.com) (>= 3.5.0)
|
||||
* [jQuery](http://jquery.com) (>= 1.11.0)
|
||||
* [jQuery UI](http://jqueryui.com) (>= 1.11.0). Minimum required components: Core, Widget, Mouse, Draggable, Resizable
|
||||
* (Optional) [knockout.js](http://knockoutjs.com) (>= 3.2.0)
|
||||
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
|
||||
* [lodash.js](https://lodash.com) (>= 3.5.0, full build)
|
||||
* [jQuery](http://jquery.com) (>= 3.1.0)
|
||||
|
||||
Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) instead of lodash.js
|
||||
|
||||
#### Using gridstack.js with jQuery UI
|
||||
|
||||
* [jQuery UI](http://jqueryui.com) (>= 1.12.0). Minimum required components: Core, Widget, Mouse, Draggable, Resizable
|
||||
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
|
||||
|
||||
## Install
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="gridstack.css" />
|
||||
<script src="gridstack.js"></script>
|
||||
<script src="gridstack.jQueryUI.js"></script>
|
||||
```
|
||||
|
||||
* Using CDN:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.6/gridstack.min.css" />
|
||||
<script type="text/javascript" src='//cdnjs.cloudflare.com/ajax/libs/gridstack.js/0.2.6/gridstack.min.js'></script>
|
||||
```
|
||||
|
||||
* Using bower:
|
||||
|
||||
```bash
|
||||
$ bower install gridstack
|
||||
```
|
||||
|
||||
* Using npm:
|
||||
|
||||
[![NPM version](https://img.shields.io/npm/v/gridstack.svg)](https://www.npmjs.com/package/gridstack)
|
||||
|
||||
```bash
|
||||
$ npm install gridstack
|
||||
```
|
||||
|
||||
You can download files from `dist` directory as well.
|
||||
|
||||
## Basic usage
|
||||
|
||||
```html
|
||||
<div class="grid-stack">
|
||||
<div class="grid-stack-item"
|
||||
data-gs-x="0" data-gs-y="0"
|
||||
<div class="grid-stack-item"
|
||||
data-gs-x="0" data-gs-y="0"
|
||||
data-gs-width="4" data-gs-height="2">
|
||||
<div class="grid-stack-item-content"></div>
|
||||
</div>
|
||||
<div class="grid-stack-item"
|
||||
data-gs-x="4" data-gs-y="0"
|
||||
<div class="grid-stack-item"
|
||||
data-gs-x="4" data-gs-y="0"
|
||||
data-gs-width="4" data-gs-height="4">
|
||||
<div class="grid-stack-item-content"></div>
|
||||
</div>
|
||||
|
@ -105,270 +132,49 @@ Note: You can still use [underscore.js](http://underscorejs.org) (>= 1.7.0) inst
|
|||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var options = {
|
||||
cell_height: 80,
|
||||
vertical_margin: 10
|
||||
cellHeight: 80,
|
||||
verticalMargin: 10
|
||||
};
|
||||
$('.grid-stack').gridstack(options);
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
## Options
|
||||
## Migrating to v0.3.0
|
||||
|
||||
- `always_show_resize_handle` - if `true` the resizing handles are shown even if the user is not hovering over the widget
|
||||
(default: `false`)
|
||||
- `animate` - turns animation on (default: `false`)
|
||||
- `auto` - if `false` gridstack will not initialize existing items (default: `true`)
|
||||
- `cell_height` - one cell height (default: `60`)
|
||||
- `draggable` - allows to override jQuery UI draggable options. (default: `{handle: '.grid-stack-item-content', scroll: true, appendTo: 'body'}`)
|
||||
- `handle` - draggable handle selector (default: `'.grid-stack-item-content'`)
|
||||
- `height` - maximum rows amount. Default is `0` which means no maximum rows
|
||||
- `float` - enable floating widgets (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/float.html)
|
||||
- `item_class` - widget class (default: `'grid-stack-item'`)
|
||||
- `min_width` - minimal width. If window width is less, grid will be shown in one-column mode (default: `768`)
|
||||
- `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`)
|
||||
- `resizable` - allows to override jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`)
|
||||
- `vertical_margin` - vertical gap size (default: `20`)
|
||||
- `width` - amount of columns (default: `12`)
|
||||
As of v0.3.0, gridstack introduces a new plugin system. The drag'n'drop functionality has been modified to take advantage of this system. Because of this, and to avoid dependency on core code from jQuery UI, the plugin was functionality was moved to a separate file.
|
||||
|
||||
## Grid attributes
|
||||
To ensure gridstack continues to work, either include the additional `gridstack.jQueryUI.js` file into your HTML or use `gridstack.all.js`:
|
||||
|
||||
- `data-gs-animate` - turns animation on
|
||||
- `data-gs-width` - amount of columns
|
||||
- `data-gs-height` - maximum rows amount. Default is `0` which means no maximum rows.
|
||||
|
||||
## Item attributes
|
||||
|
||||
- `data-gs-x`, `data-gs-y` - element position
|
||||
- `data-gs-width`, `data-gs-height` - element size
|
||||
- `data-gs-max-width`, `data-gs-min-width`, `data-gs-max-height`, `data-gs-min-height` - element constraints
|
||||
- `data-gs-no-resize` - disable element resizing
|
||||
- `data-gs-no-move` - disable element moving
|
||||
- `data-gs-auto-position` - tells to ignore `data-gs-x` and `data-gs-y` attributes and to place element to the first
|
||||
available position
|
||||
- `data-gs-locked` - the widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing.
|
||||
The widget can still be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes
|
||||
to completely lock the widget.
|
||||
|
||||
## Events
|
||||
|
||||
### onchange(items)
|
||||
|
||||
Occurs when widgets change their position/size
|
||||
|
||||
```javascript
|
||||
var serialize_widget_map = function (items) {
|
||||
console.log(items);
|
||||
};
|
||||
|
||||
$('.grid-stack').on('change', function (e, items) {
|
||||
serialize_widget_map(items);
|
||||
});
|
||||
```html
|
||||
<script src="gridstack.js"></script>
|
||||
<script src="gridstack.jQueryUI.js"></script>
|
||||
```
|
||||
|
||||
### ondragstart(event, ui)
|
||||
or
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('dragstart', function (event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```html
|
||||
<script src="gridstack.all.js"></script>
|
||||
```
|
||||
|
||||
### ondragstop(event, ui)
|
||||
We're working on implementing support for other drag'n'drop libraries through the new plugin system.
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('dragstop', function (event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
## Migrating to v0.2.5
|
||||
|
||||
### onresizestart(event, ui)
|
||||
As of v0.2.5 all methods and parameters are in camel case to respect [JavaScript Style Guide and Coding Conventions](http://www.w3schools.com/js/js_conventions.asp).
|
||||
All old methods and parameters are marked as deprecated and still available but a warning will be displayed in js console. They will be available until v1.0
|
||||
when they will be completely removed.
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('resizestart', function (event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
## API Documentation
|
||||
|
||||
### onresizestop(event, ui)
|
||||
Please check out `doc/README.md` for more information about gridstack.js API.
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('resizestop', function (event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
## Questions and Answers
|
||||
|
||||
Please feel free to as a questions here in issues, using [Stackoverflow](http://stackoverflow.com/search?q=gridstack) or [Slack chat](https://gridstackjs.troolee.com).
|
||||
We will glad to answer and help you as soon as we can.
|
||||
|
||||
## API
|
||||
|
||||
### add_widget(el, x, y, width, height, auto_position)
|
||||
|
||||
Creates new widget and returns it.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to add
|
||||
- `x`, `y`, `width`, `height` - widget position/dimensions (Optional)
|
||||
- `auto_position` - if `true` then `x`, `y` parameters will be ignored and widget will be places on the first available
|
||||
position
|
||||
|
||||
Widget will be always placed even if result height is more than actual grid height. You need to use `will_it_fit` method
|
||||
before calling `add_widget` for additional check.
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').gridstack();
|
||||
|
||||
var grid = $('.grid-stack').data('gridstack');
|
||||
grid.add_widget(el, 0, 0, 3, 2, true);
|
||||
```
|
||||
|
||||
### batch_update()
|
||||
|
||||
Initailizes batch updates. You will see no changes until `commit` method is called.
|
||||
|
||||
### cell_height()
|
||||
|
||||
Gets current cell height.
|
||||
|
||||
### cell_height(val)
|
||||
|
||||
Update current cell height. This method rebuilds an internal CSS stylesheet. Note: You can expect performance issues if
|
||||
call this method too often.
|
||||
|
||||
```javascript
|
||||
grid.cell_height(grid.cell_width() * 1.2);
|
||||
```
|
||||
|
||||
### cell_width()
|
||||
|
||||
Gets current cell width.
|
||||
|
||||
### commit()
|
||||
|
||||
Finishes batch updates. Updates DOM nodes. You must call it after `batch_update`.
|
||||
|
||||
### disable()
|
||||
|
||||
Disables widgets moving/resizing. This is a shortcut for:
|
||||
|
||||
```javascript
|
||||
grid.movable('.grid-stack-item', false);
|
||||
grid.resizable('.grid-stack-item', false);
|
||||
```
|
||||
|
||||
### enable()
|
||||
|
||||
Enables widgets moving/resizing. This is a shortcut for:
|
||||
|
||||
```javascript
|
||||
grid.movable('.grid-stack-item', true);
|
||||
grid.resizable('.grid-stack-item', true);
|
||||
```
|
||||
|
||||
### get_cell_from_pixel(position)
|
||||
|
||||
Get the position of the cell under a pixel on screen.
|
||||
|
||||
Parameters :
|
||||
|
||||
- `position` - the position of the pixel to resolve in absolute coordinates, as an object with `top` and `left`properties
|
||||
|
||||
Returns an object with properties `x` and `y` i.e. the column and row in the grid.
|
||||
|
||||
### is_area_empty(x, y, width, height)
|
||||
|
||||
Checks if specified area is empty.
|
||||
|
||||
### locked(el, val)
|
||||
|
||||
Locks/unlocks widget.
|
||||
|
||||
- `el` - widget to modify.
|
||||
- `val` - if `true` widget will be locked.
|
||||
|
||||
### remove_widget(el, detach_node)
|
||||
|
||||
Removes widget from the grid.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to remove.
|
||||
- `detach_node` - if `false` DOM node won't be removed from the tree (Optional. Default `true`).
|
||||
|
||||
### remove_all()
|
||||
|
||||
Removes all widgets from the grid.
|
||||
|
||||
### resize(el, width, height)
|
||||
|
||||
Changes widget size
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to resize
|
||||
- `width`, `height` - new dimensions. If value is `null` or `undefined` it will be ignored.
|
||||
|
||||
### move(el, x, y)
|
||||
|
||||
Changes widget position
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to move
|
||||
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
|
||||
|
||||
### resizable(el, val)
|
||||
|
||||
Enables/Disables resizing.
|
||||
|
||||
- `el` - widget to modify
|
||||
- `val` - if `true` widget will be resizable.
|
||||
|
||||
### movable(el, val)
|
||||
|
||||
Enables/Disables moving.
|
||||
|
||||
- `el` - widget to modify
|
||||
- `val` - if `true` widget will be draggable.
|
||||
|
||||
### update(el, x, y, width, height)
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to move
|
||||
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
|
||||
- `width`, `height` - new dimensions. If value is `null` or `undefined` it will be ignored.
|
||||
|
||||
Updates widget position/size.
|
||||
|
||||
### will_it_fit(x, y, width, height, auto_position)
|
||||
|
||||
Returns `true` if the `height` of the grid will be less the vertical constraint. Always returns `true` if grid doesn't
|
||||
have `height` constraint.
|
||||
|
||||
```javascript
|
||||
if (grid.will_it_fit(new_node.x, new_node.y, new_node.width, new_node.height, true)) {
|
||||
grid.add_widget(new_node.el, new_node.x, new_node.y, new_node.width, new_node.height, true);
|
||||
}
|
||||
else {
|
||||
alert('Not enough free space to place the widget');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Utils
|
||||
|
||||
### GridStackUI.Utils.sort(nodes, dir, width)
|
||||
|
||||
Sorts array of nodes
|
||||
|
||||
- `nodes` - array to sort
|
||||
- `dir` - `1` for asc, `-1` for desc (optional)
|
||||
- `width` - width of the grid. If `undefined` the width will be calculated automatically (optional).
|
||||
Also please check our FAQ `doc/FAQ.md` before asking in case the answer is already there.
|
||||
|
||||
## Touch devices support
|
||||
|
||||
|
@ -384,17 +190,19 @@ working on touch-based devices.
|
|||
<script src="gridstack.js"></script>
|
||||
```
|
||||
|
||||
Also `always_show_resize_handle` option may be useful:
|
||||
Also `alwaysShowResizeHandle` option may be useful:
|
||||
|
||||
```javascript
|
||||
$(function () {
|
||||
var options = {
|
||||
always_show_resize_handle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
|
||||
alwaysShowResizeHandle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
|
||||
};
|
||||
$('.grid-stack').gridstack(options);
|
||||
});
|
||||
```
|
||||
|
||||
If you're still experiencing issues on touch devices please check [#444](https://github.com/troolee/gridstack.js/issues/444)
|
||||
|
||||
## Use with knockout.js
|
||||
|
||||
```javascript
|
||||
|
@ -414,9 +222,9 @@ ko.components.register('dashboard-grid', {
|
|||
}
|
||||
|
||||
var item = _.find(items, function (i) { return i.nodeType == 1 });
|
||||
grid.add_widget(item);
|
||||
grid.addWidget(item);
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(item, function () {
|
||||
grid.remove_widget(item);
|
||||
grid.removeWidget(item);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
@ -427,7 +235,7 @@ ko.components.register('dashboard-grid', {
|
|||
template:
|
||||
[
|
||||
'<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">',
|
||||
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position}">',
|
||||
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.autoPosition}">',
|
||||
' <div class="grid-stack-item-content">...</div>',
|
||||
' </div>',
|
||||
'</div> '
|
||||
|
@ -460,24 +268,34 @@ See examples: [example 1](http://troolee.github.io/gridstack.js/demo/knockout.ht
|
|||
|
||||
**Notes:** It's very important to exclude training spaces after widget template:
|
||||
|
||||
```
|
||||
```javascript
|
||||
template:
|
||||
[
|
||||
'<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">',
|
||||
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position}">',
|
||||
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.autoPosition}">',
|
||||
' ....',
|
||||
' </div>', // <-- NO SPACE **AFTER** </div>
|
||||
'</div> ' // <-- NO SPACE **BEFORE** </div>
|
||||
].join('') // <-- JOIN WITH **EMPTY** STRING
|
||||
].join('') // <-- JOIN WITH **EMPTY** STRING
|
||||
```
|
||||
|
||||
Otherwise `addDisposeCallback` won't work.
|
||||
|
||||
|
||||
## Use with angular.js
|
||||
|
||||
Please check [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
|
||||
|
||||
|
||||
## Rails integration
|
||||
|
||||
For rails users, integration of gridstack.js and its dependencies can be done through [gridstack-js-rails](https://github.com/randoum/gridstack-js-rails)
|
||||
|
||||
|
||||
## Change grid width
|
||||
|
||||
To change grid width (columns count), to addition to `width` option, CSS rules
|
||||
for `.grid-stack-item[data-gs-width="X"]` and `.grid-stack-item[data-gs-x="X"]` have to be changed accordingly.
|
||||
To change grid width (columns count), to addition to `width` option, CSS rules
|
||||
for `.grid-stack-item[data-gs-width="X"]` and `.grid-stack-item[data-gs-x="X"]` have to be changed accordingly.
|
||||
|
||||
For instance for 3-column grid you need to rewrite CSS to be:
|
||||
|
||||
|
@ -526,7 +344,7 @@ Or you can include `gridstack-extra.css`. See below for more details.
|
|||
## Extra CSS
|
||||
|
||||
There are few extra CSS batteries in `gridstack-extra.css` (`gridstack-extra.min.css`).
|
||||
|
||||
|
||||
### Different grid widths
|
||||
|
||||
You can use other than 12 grid width:
|
||||
|
@ -543,7 +361,7 @@ See example: [2 grids demo](http://troolee.github.io/gridstack.js/demo/two.html)
|
|||
## Save grid to array
|
||||
|
||||
Because gridstack doesn't track any kind of user-defined widget id there is no reason to make serialization to be part
|
||||
of gridstack API. To serialize grid you can simply do something like this (let's say you store widget id inside `data-custom-id`
|
||||
of gridstack API. To serialize grid you can simply do something like this (let's say you store widget id inside `data-custom-id`
|
||||
attribute):
|
||||
|
||||
```javascript
|
||||
|
@ -563,7 +381,7 @@ alert(JSON.stringify(res));
|
|||
|
||||
See example: [Serialization demo](http://troolee.github.io/gridstack.js/demo/serialization.html)
|
||||
|
||||
You can also use `onchange` event if you need to save only changed widgets right away they have been changed.
|
||||
You can also use `onchange` event if you need to save only changed widgets right away they have been changed.
|
||||
|
||||
## Load grid from array
|
||||
|
||||
|
@ -582,10 +400,10 @@ var serialization = [
|
|||
serialization = GridStackUI.Utils.sort(serialization);
|
||||
|
||||
var grid = $('.grid-stack').data('gridstack');
|
||||
grid.remove_all();
|
||||
grid.removeAll();
|
||||
|
||||
_.each(serialization, function (node) {
|
||||
grid.add_widget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
grid.addWidget($('<div><div class="grid-stack-item-content" /></div>'),
|
||||
node.x, node.y, node.width, node.height);
|
||||
});
|
||||
```
|
||||
|
@ -651,20 +469,95 @@ for i in range(N):
|
|||
print '.grid-stack > .grid-stack-item[data-gs-y="%(index)s"] { top: %(height)spx }' % {'index': i , 'height': h}
|
||||
```
|
||||
|
||||
There are at least two more issues with gridstack in IE8 with jQueryUI resizable (it seems it doesn't work) and
|
||||
droppable. If you have any suggestions about support of IE8 you are welcome here: https://github.com/troolee/gridstack.js/issues/76
|
||||
There are at least two more issues with gridstack in IE8 with jQueryUI resizable (it seems it doesn't work) and
|
||||
droppable. If you have any suggestions about support of IE8 you are welcome here: https://github.com/troolee/gridstack.js/issues/76
|
||||
|
||||
## Use with require.js
|
||||
|
||||
If you're using require.js and a single file jQueryUI please check out this
|
||||
[Stackoverflow question](http://stackoverflow.com/questions/35582945/redundant-dependencies-with-requirejs) to get it
|
||||
working properly.
|
||||
|
||||
|
||||
## Nested grids
|
||||
|
||||
Gridstack may be nested. All nested grids have an additional class `grid-stack-nested` which is assigned automatically
|
||||
during initialization.
|
||||
Gridstack may be nested. All nested grids have an additional class `grid-stack-nested` which is assigned automatically
|
||||
during initialization.
|
||||
See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/nested.html)
|
||||
|
||||
|
||||
## Resizing active grid
|
||||
|
||||
Resizing on-the-fly is possible, though experimental. This may be used to make gridstack responsive. gridstack will change the total number of columns and will attempt to update the width and x values of each widget to be more logical.
|
||||
See example: [Responsive grid demo](http://troolee.github.io/gridstack.js/demo/responsive.html)
|
||||
|
||||
## Using AniJS
|
||||
|
||||
Using AniJS with gridstack is a breeze. In the following example, a listener is added that gets triggered by a widget being added.
|
||||
See widgets wiggle! [AniJS demo](http://troolee.github.io/gridstack.js/demo/anijs.html)
|
||||
|
||||
The Team
|
||||
========
|
||||
|
||||
gridstack.js is currently maintained by [Pavel Reznikov](https://github.com/troolee), [Dylan Weiss](https://github.com/radiolips)
|
||||
and [Kevin Dietrich](https://github.com/kdietrich). And we appreciate [all contributors](https://github.com/troolee/gridstack.js/graphs/contributors)
|
||||
for help.
|
||||
|
||||
|
||||
Changes
|
||||
=======
|
||||
|
||||
#### v0.3.0-dev (Development Version)
|
||||
|
||||
- add oneColumnModeClass option to grid.
|
||||
- remove 768px CSS styles, moved to grid-stack-one-column-mode class.
|
||||
- add max-width override on grid-stck-one-column-mode ([#462](https://github.com/troolee/gridstack.js/issues/462)).
|
||||
- add internal function`isNodeChangedPosition`, minor optimization to move/drag.
|
||||
- drag'n'drop plugin system. Move jQuery UI dependencies to separate plugin file.
|
||||
|
||||
#### v0.2.6 (2016-08-17)
|
||||
|
||||
- update requirements to the latest versions of jQuery (v3.1.0+) and jquery-ui (v1.12.0+).
|
||||
- fix jQuery `size()` ([#486](https://github.com/troolee/gridstack.js/issues/486)).
|
||||
- update `destroy([detachGrid])` call ([#422](https://github.com/troolee/gridstack.js/issues/422)).
|
||||
- don't mutate options when calling `draggable` and `resizable`. ([#505](https://github.com/troolee/gridstack.js/issues/505)).
|
||||
- update _notify to allow detach ([#411](https://github.com/troolee/gridstack.js/issues/411)).
|
||||
- fix code that checks for jquery-ui ([#481](https://github.com/troolee/gridstack.js/issues/481)).
|
||||
- fix `cellWidth` calculation on empty grid
|
||||
|
||||
#### v0.2.5 (2016-03-02)
|
||||
|
||||
- update names to respect js naming convention.
|
||||
- `cellHeight` and `verticalMargin` can now be string (e.g. '3em', '20px') (Thanks to @jlowcs).
|
||||
- add `maxWidth`/`maxHeight` methods.
|
||||
- add `enableMove`/`enableResize` methods.
|
||||
- fix window resize issue #331.
|
||||
- add options `disableDrag` and `disableResize`.
|
||||
- fix `batchUpdate`/`commit` (Thank to @radiolips)
|
||||
- remove dependency of FontAwesome
|
||||
- RTL support
|
||||
- `'auto'` value for `cellHeight` option
|
||||
- fix `setStatic` method
|
||||
- add `setAnimation` method to API
|
||||
- add `setGridWidth` method ([#227](https://github.com/troolee/gridstack.js/issues/227))
|
||||
- add `removable`/`removeTimeout` *(experimental)*
|
||||
- add `detachGrid` parameter to `destroy` method ([#216](https://github.com/troolee/gridstack.js/issues/216)) (thanks @jhpedemonte)
|
||||
- add `useOffset` parameter to `getCellFromPixel` method ([#237](https://github.com/troolee/gridstack.js/issues/237))
|
||||
- add `minWidth`, `maxWidth`, `minHeight`, `maxHeight`, `id` parameters to `addWidget` ([#188](https://github.com/troolee/gridstack.js/issues/188))
|
||||
- add `added` and `removed` events for when a widget is added or removed, respectively. ([#54](https://github.com/troolee/gridstack.js/issues/54))
|
||||
- add `acceptWidgets` parameter. Widgets can now be draggable between grids or from outside *(experimental)*
|
||||
|
||||
#### v0.2.4 (2016-02-15)
|
||||
|
||||
- fix closure compiler/linter warnings
|
||||
- add `static_grid` option.
|
||||
- add `min_width`/`min_height` methods (Thanks to @cvillemure)
|
||||
- add `destroy` method (Thanks to @zspitzer)
|
||||
- add `placeholder_text` option (Thanks to @slauyama)
|
||||
- add `handle_class` option.
|
||||
- add `make_widget` method.
|
||||
- lodash v 4.x support (Thanks to @andrewr88)
|
||||
|
||||
#### v0.2.3 (2015-06-23)
|
||||
|
||||
- gridstack-extra.css
|
||||
|
@ -705,7 +598,7 @@ Changes
|
|||
- auto-generate css rules (widgets `height` and `top`)
|
||||
- add `GridStackUI.Utils.sort` utility function
|
||||
- add `remove_all` API method
|
||||
- add `resize` and `move` API methods
|
||||
- add `resize` and `move` API methods
|
||||
- add `resizable` and `movable` API methods
|
||||
- add `data-gs-no-move` attribute
|
||||
- add `float` option
|
||||
|
@ -722,7 +615,7 @@ License
|
|||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015 Pavel Reznikov
|
||||
Copyright (c) 2014-2016 Pavel Reznikov, Dylan Weiss
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -741,4 +634,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gridstack",
|
||||
"version": "0.2.2",
|
||||
"version": "0.3.0-dev",
|
||||
"homepage": "https://github.com/troolee/gridstack.js",
|
||||
"authors": [
|
||||
"Pavel Reznikov <pashka.reznikov@gmail.com>"
|
||||
|
@ -14,9 +14,9 @@
|
|||
"amd"
|
||||
],
|
||||
"dependencies": {
|
||||
"lodash": ">= 3.5.0",
|
||||
"jquery": ">= 1.11.0",
|
||||
"jquery-ui": ">= 1.11.0"
|
||||
"lodash": ">= 4.14.2",
|
||||
"jquery": ">= 3.1.0",
|
||||
"jquery-ui": ">= 1.12.0"
|
||||
},
|
||||
"keywords": [
|
||||
"gridstack",
|
||||
|
|
89
demo/anijs.html
Normal file
89
demo/anijs.html
Normal file
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>AniJS demo</title>
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
<link rel="stylesheet" href="https://anijs.github.io/lib/anicollection/anicollection.css" />
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
background: lightgoldenrodyellow;
|
||||
}
|
||||
|
||||
.grid-stack-item-content {
|
||||
color: #2c3e50;
|
||||
text-align: center;
|
||||
background-color: #18bc9c;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<h1>AniJS demo</h1>
|
||||
|
||||
<div>
|
||||
<a class="btn btn-default" id="add-widget" href="#">Add Widget</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4>Widget added</h4>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="grid-stack">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/AniJS/0.9.3/anijs.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.grid-stack').gridstack();
|
||||
var self = this;
|
||||
this.grid = $('.grid-stack').data('gridstack');
|
||||
$('.grid-stack').on('added', function(event, items) {
|
||||
// add anijs data to gridstack item
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
$(items[i].el[0]).attr('data-anijs', 'if: added, do: swing animated, after: $removeAnimations, on: $gridstack');
|
||||
}
|
||||
AniJS.run();
|
||||
self.gridstackNotifier = AniJS.getNotifier('gridstack');
|
||||
// fire added event!
|
||||
self.gridstackNotifier.dispatchEvent('added');
|
||||
});
|
||||
$('#add-widget').click(function() {
|
||||
addNewWidget();
|
||||
});
|
||||
|
||||
function addNewWidget() {
|
||||
var grid = $('.grid-stack').data('gridstack');
|
||||
grid.addWidget($('<div><div class="grid-stack-item-content"></div></div>'), 0, 0, Math.floor(1 + 3 * Math.random()), Math.floor(1 + 3 * Math.random()), true);
|
||||
}
|
||||
|
||||
var animationHelper = AniJS.getHelper();
|
||||
|
||||
//Defining removeAnimations to remove existing animations
|
||||
animationHelper.removeAnimations = function(e, animationContext){
|
||||
$('.grid-stack-item').attr('data-anijs', '');
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -10,15 +10,15 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Float grid demo</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
|
@ -68,18 +68,19 @@
|
|||
|
||||
this.grid = $('.grid-stack').data('gridstack');
|
||||
|
||||
this.add_new_widget = function () {
|
||||
this.addNewWidget = function () {
|
||||
var node = this.items.pop() || {
|
||||
x: 12 * Math.random(),
|
||||
y: 5 * Math.random(),
|
||||
width: 1 + 3 * Math.random(),
|
||||
height: 1 + 3 * Math.random()
|
||||
};
|
||||
this.grid.add_widget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
this.grid.addWidget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
node.x, node.y, node.width, node.height);
|
||||
return false;
|
||||
}.bind(this);
|
||||
|
||||
$('#add-new-widget').click(this.add_new_widget);
|
||||
$('#add-new-widget').click(this.addNewWidget);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
|
20
demo/index.html
Normal file
20
demo/index.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="float.html">Float grid demo</a></li>
|
||||
<li><a href="knockout.html">Knockout.js demo</a></li>
|
||||
<li><a href="knockout2.html">Knockout.js demo (2)</a></li>
|
||||
<li><a href="nested.html">Nested grids demo</a></li>
|
||||
<li><a href="rtl.html">RTL demo</a></li>
|
||||
<li><a href="serialization.html">Serialization demo</a></li>
|
||||
<li><a href="two.html">Two grids demo</a></li>
|
||||
<li><a href="responsive.html">Resize grid (responsive) demo</a></li>
|
||||
<li><a href="anijs.html">AniJS demo</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
|
@ -10,16 +10,16 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Knockout.js demo</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
|
@ -38,7 +38,7 @@
|
|||
<h1>knockout.js Demo</h1>
|
||||
|
||||
<div>
|
||||
<button data-bind="click: add_new_widget">Add new widget</button>
|
||||
<button data-bind="click: addNewWidget">Add new widget</button>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
@ -64,9 +64,9 @@
|
|||
}
|
||||
|
||||
var item = _.find(items, function (i) { return i.nodeType == 1 });
|
||||
grid.add_widget(item);
|
||||
grid.addWidget(item);
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(item, function () {
|
||||
grid.remove_widget(item);
|
||||
grid.removeWidget(item);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
@ -78,7 +78,7 @@
|
|||
[
|
||||
'<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">',
|
||||
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position}">',
|
||||
' <div class="grid-stack-item-content"><button data-bind="click: $root.delete_widget">Delete me</button></div>',
|
||||
' <div class="grid-stack-item-content"><button data-bind="click: $root.deleteWidget">Delete me</button></div>',
|
||||
' </div>',
|
||||
'</div> '
|
||||
].join('')
|
||||
|
@ -90,7 +90,7 @@
|
|||
|
||||
this.widgets = ko.observableArray(widgets);
|
||||
|
||||
this.add_new_widget = function () {
|
||||
this.addNewWidget = function () {
|
||||
this.widgets.push({
|
||||
x: 0,
|
||||
y: 0,
|
||||
|
@ -98,10 +98,12 @@
|
|||
height: Math.floor(1 + 3 * Math.random()),
|
||||
auto_position: true
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
this.delete_widget = function (item) {
|
||||
this.deleteWidget = function (item) {
|
||||
self.widgets.remove(item);
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Knockout.js demo</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
|
@ -38,7 +38,7 @@
|
|||
<h1>knockout.js Demo</h1>
|
||||
|
||||
<div>
|
||||
<button data-bind="click: add_new_widget">Add new widget</button>
|
||||
<button data-bind="click: addNewWidget">Add new widget</button>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
@ -64,9 +64,9 @@
|
|||
}
|
||||
|
||||
var item = _.find(items, function (i) { return i.nodeType == 1 });
|
||||
grid.add_widget(item);
|
||||
grid.addWidget(item);
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(item, function () {
|
||||
grid.remove_widget(item);
|
||||
grid.removeWidget(item);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
@ -83,7 +83,7 @@
|
|||
|
||||
this.widgets = ko.observableArray(widgets);
|
||||
|
||||
this.add_new_widget = function () {
|
||||
this.addNewWidget = function () {
|
||||
this.widgets.push({
|
||||
x: 0,
|
||||
y: 0,
|
||||
|
@ -91,10 +91,12 @@
|
|||
height: Math.floor(1 + 3 * Math.random()),
|
||||
auto_position: true
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
this.delete_widget = function (item) {
|
||||
this.deleteWidget = function (item) {
|
||||
self.widgets.remove(item);
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -113,7 +115,7 @@
|
|||
<template id="gridstack-template">
|
||||
<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">
|
||||
<div class="grid-stack-item" data-bind="attr: {'data-gs-x': $data.x, 'data-gs-y': $data.y, 'data-gs-width': $data.width, 'data-gs-height': $data.height, 'data-gs-auto-position': $data.auto_position}">
|
||||
<div class="grid-stack-item-content"><button data-bind="click: $root.delete_widget">Delete me</button></div>
|
||||
<div class="grid-stack-item-content"><button data-bind="click: $root.deleteWidget">Delete me</button></div>
|
||||
</div></div><!-- <---- NO SPACE BETWEEN THESE CLOSING TAGS -->
|
||||
</template>
|
||||
</body>
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Nested grids demo</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
|
|
122
demo/responsive.html
Normal file
122
demo/responsive.html
Normal file
|
@ -0,0 +1,122 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Responsive grid demo</title>
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
<link rel="stylesheet" href="../dist/gridstack-extra.css"/>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
background: lightgoldenrodyellow;
|
||||
}
|
||||
|
||||
.grid-stack-item-content {
|
||||
color: #2c3e50;
|
||||
text-align: center;
|
||||
background-color: #18bc9c;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="device-xs visible-xs"></div>
|
||||
<div class="device-sm visible-sm"></div>
|
||||
<div class="device-md visible-md"></div>
|
||||
<div class="device-lg visible-lg"></div>
|
||||
<div class="device-xl visible-xl"></div>
|
||||
<div class="container-fluid">
|
||||
<h1>Responsive grid demo</h1>
|
||||
|
||||
<div>
|
||||
<span>Number of Columns:</span> <span id="grid-size"></span>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="grid-stack">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// thanks to http://stackoverflow.com/a/22885503
|
||||
var waitForFinalEvent=function(){var b={};return function(c,d,a){a||(a="I am a banana!");b[a]&&clearTimeout(b[a]);b[a]=setTimeout(c,d)}}();
|
||||
var fullDateString = new Date();
|
||||
function isBreakpoint(alias) {
|
||||
return $('.device-' + alias).is(':visible');
|
||||
}
|
||||
|
||||
|
||||
var options = {
|
||||
float: false
|
||||
};
|
||||
$('.grid-stack').gridstack(options);
|
||||
function resizeGrid() {
|
||||
var grid = $('.grid-stack').data('gridstack');
|
||||
if (isBreakpoint('xs')) {
|
||||
$('#grid-size').text('One column mode');
|
||||
} else if (isBreakpoint('sm')) {
|
||||
grid.setGridWidth(3);
|
||||
$('#grid-size').text(3);
|
||||
} else if (isBreakpoint('md')) {
|
||||
grid.setGridWidth(6);
|
||||
$('#grid-size').text(6);
|
||||
} else if (isBreakpoint('lg')) {
|
||||
grid.setGridWidth(12);
|
||||
$('#grid-size').text(12);
|
||||
}
|
||||
};
|
||||
$(window).resize(function () {
|
||||
waitForFinalEvent(function() {
|
||||
resizeGrid();
|
||||
}, 300, fullDateString.getTime());
|
||||
});
|
||||
|
||||
new function () {
|
||||
this.serializedData = [
|
||||
{x: 0, y: 0, width: 4, height: 2},
|
||||
{x: 3, y: 1, width: 4, height: 2},
|
||||
{x: 4, y: 1, width: 4, height: 1},
|
||||
{x: 2, y: 3, width: 8, height: 1},
|
||||
{x: 0, y: 4, width: 4, height: 1},
|
||||
{x: 0, y: 3, width: 4, height: 1},
|
||||
{x: 2, y: 4, width: 4, height: 1},
|
||||
{x: 2, y: 5, width: 4, height: 1},
|
||||
{x: 0, y: 6, width: 12, height: 1}
|
||||
];
|
||||
|
||||
this.grid = $('.grid-stack').data('gridstack');
|
||||
|
||||
this.loadGrid = function () {
|
||||
this.grid.removeAll();
|
||||
var items = GridStackUI.Utils.sort(this.serializedData);
|
||||
_.each(items, function (node, i) {
|
||||
this.grid.addWidget($('<div><div class="grid-stack-item-content">' + i + '</div></div>'),
|
||||
node.x, node.y, node.width, node.height);
|
||||
}, this);
|
||||
return false;
|
||||
}.bind(this);
|
||||
|
||||
this.loadGrid();
|
||||
resizeGrid();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
121
demo/rtl.html
Normal file
121
demo/rtl.html
Normal file
|
@ -0,0 +1,121 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" dir="rtl">
|
||||
<head>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>RTL demo</title>
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
background: lightgoldenrodyellow;
|
||||
}
|
||||
|
||||
.grid-stack-item-content {
|
||||
color: #2c3e50;
|
||||
background-color: #18bc9c;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<h1>RTL Demo</h1>
|
||||
|
||||
<div>
|
||||
<button data-bind="click: addNewWidget">Add new widget</button>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div data-bind="component: {name: 'dashboard-grid', params: $data}"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
ko.components.register('dashboard-grid', {
|
||||
viewModel: {
|
||||
createViewModel: function (controller, componentInfo) {
|
||||
var ViewModel = function (controller, componentInfo) {
|
||||
var grid = null;
|
||||
|
||||
this.widgets = controller.widgets;
|
||||
|
||||
this.afterAddWidget = function (items) {
|
||||
if (grid == null) {
|
||||
grid = $(componentInfo.element).find('.grid-stack').gridstack({
|
||||
auto: false
|
||||
}).data('gridstack');
|
||||
}
|
||||
|
||||
var item = _.find(items, function (i) { return i.nodeType == 1 });
|
||||
grid.addWidget(item);
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(item, function () {
|
||||
grid.removeWidget(item);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
return new ViewModel(controller, componentInfo);
|
||||
}
|
||||
},
|
||||
template:
|
||||
[
|
||||
'<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">',
|
||||
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position}">',
|
||||
' <div class="grid-stack-item-content"><center><button data-bind="click: $root.deleteWidget">Delete me</button><br><h5 data-bind="text: index" /></center><br><p>lorem ipsum</p></div>',
|
||||
' </div>',
|
||||
'</div> '
|
||||
].join('')
|
||||
});
|
||||
|
||||
$(function () {
|
||||
var Controller = function (widgets) {
|
||||
var self = this;
|
||||
|
||||
this.widgets = ko.observableArray(widgets);
|
||||
|
||||
this.addNewWidget = function () {
|
||||
this.widgets.push({
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: Math.floor(1 + 3 * Math.random()),
|
||||
height: Math.floor(1 + 3 * Math.random()),
|
||||
auto_position: true
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
this.deleteWidget = function (item) {
|
||||
self.widgets.remove(item);
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
var widgets = [
|
||||
{x: 0, y: 0, width: 2, height: 2, index: 1},
|
||||
{x: 2, y: 0, width: 4, height: 2, index: 2},
|
||||
{x: 6, y: 0, width: 2, height: 4, index: 3},
|
||||
{x: 1, y: 2, width: 4, height: 2, index: 4}
|
||||
];
|
||||
|
||||
var controller = new Controller(widgets);
|
||||
ko.applyBindings(controller);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -10,15 +10,15 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Serialization demo</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
|
@ -60,7 +60,7 @@
|
|||
$('.grid-stack').gridstack(options);
|
||||
|
||||
new function () {
|
||||
this.serialized_data = [
|
||||
this.serializedData = [
|
||||
{x: 0, y: 0, width: 2, height: 2},
|
||||
{x: 3, y: 1, width: 1, height: 2},
|
||||
{x: 4, y: 1, width: 1, height: 1},
|
||||
|
@ -73,17 +73,18 @@
|
|||
|
||||
this.grid = $('.grid-stack').data('gridstack');
|
||||
|
||||
this.load_grid = function () {
|
||||
this.grid.remove_all();
|
||||
var items = GridStackUI.Utils.sort(this.serialized_data);
|
||||
this.loadGrid = function () {
|
||||
this.grid.removeAll();
|
||||
var items = GridStackUI.Utils.sort(this.serializedData);
|
||||
_.each(items, function (node) {
|
||||
this.grid.add_widget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
this.grid.addWidget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
node.x, node.y, node.width, node.height);
|
||||
}, this);
|
||||
return false;
|
||||
}.bind(this);
|
||||
|
||||
this.save_grid = function () {
|
||||
this.serialized_data = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) {
|
||||
this.saveGrid = function () {
|
||||
this.serializedData = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) {
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
return {
|
||||
|
@ -93,18 +94,20 @@
|
|||
height: node.height
|
||||
};
|
||||
}, this);
|
||||
$('#saved-data').val(JSON.stringify(this.serialized_data, null, ' '));
|
||||
$('#saved-data').val(JSON.stringify(this.serializedData, null, ' '));
|
||||
return false;
|
||||
}.bind(this);
|
||||
|
||||
this.clear_grid = function () {
|
||||
this.grid.remove_all();
|
||||
this.clearGrid = function () {
|
||||
this.grid.removeAll();
|
||||
return false;
|
||||
}.bind(this);
|
||||
|
||||
$('#save-grid').click(this.save_grid);
|
||||
$('#load-grid').click(this.load_grid);
|
||||
$('#clear-grid').click(this.clear_grid);
|
||||
$('#save-grid').click(this.saveGrid);
|
||||
$('#load-grid').click(this.loadGrid);
|
||||
$('#clear-grid').click(this.clearGrid);
|
||||
|
||||
this.load_grid();
|
||||
this.loadGrid();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Two grids demo</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../dist/gridstack.css"/>
|
||||
<link rel="stylesheet" href="../dist/gridstack-extra.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../dist/gridstack.js"></script>
|
||||
<script src="../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
#grid1 {
|
||||
|
@ -35,12 +35,61 @@
|
|||
text-align: center;
|
||||
background-color: #18bc9c;
|
||||
}
|
||||
|
||||
#grid2 .grid-stack-item-content {
|
||||
background-color: #9caabc;
|
||||
}
|
||||
|
||||
.grid-stack-item-removing {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.trash {
|
||||
height: 150px;
|
||||
margin-bottom: 20px;
|
||||
background: rgba(255, 0, 0, 0.1) center center url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDQzOC41MjkgNDM4LjUyOSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDM4LjUyOSA0MzguNTI5OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPGc+CgkJPHBhdGggZD0iTTQxNy42ODksNzUuNjU0Yy0xLjcxMS0xLjcwOS0zLjkwMS0yLjU2OC02LjU2My0yLjU2OGgtODguMjI0TDMwMi45MTcsMjUuNDFjLTIuODU0LTcuMDQ0LTcuOTk0LTEzLjA0LTE1LjQxMy0xNy45ODkgICAgQzI4MC4wNzgsMi40NzMsMjcyLjU1NiwwLDI2NC45NDUsMGgtOTEuMzYzYy03LjYxMSwwLTE1LjEzMSwyLjQ3My0yMi41NTQsNy40MjFjLTcuNDI0LDQuOTQ5LTEyLjU2MywxMC45NDQtMTUuNDE5LDE3Ljk4OSAgICBsLTE5Ljk4NSw0Ny42NzZoLTg4LjIyYy0yLjY2NywwLTQuODUzLDAuODU5LTYuNTY3LDIuNTY4Yy0xLjcwOSwxLjcxMy0yLjU2OCwzLjkwMy0yLjU2OCw2LjU2N3YxOC4yNzQgICAgYzAsMi42NjQsMC44NTUsNC44NTQsMi41NjgsNi41NjRjMS43MTQsMS43MTIsMy45MDQsMi41NjgsNi41NjcsMi41NjhoMjcuNDA2djI3MS44YzAsMTUuODAzLDQuNDczLDI5LjI2NiwxMy40MTgsNDAuMzk4ICAgIGM4Ljk0NywxMS4xMzksMTkuNzAxLDE2LjcwMywzMi4yNjQsMTYuNzAzaDIzNy41NDJjMTIuNTY2LDAsMjMuMzE5LTUuNzU2LDMyLjI2NS0xNy4yNjhjOC45NDUtMTEuNTIsMTMuNDE1LTI1LjE3NCwxMy40MTUtNDAuOTcxICAgIFYxMDkuNjI3aDI3LjQxMWMyLjY2MiwwLDQuODUzLTAuODU2LDYuNTYzLTIuNTY4YzEuNzA4LTEuNzA5LDIuNTctMy45LDIuNTctNi41NjRWODIuMjIxICAgIEM0MjAuMjYsNzkuNTU3LDQxOS4zOTcsNzcuMzY3LDQxNy42ODksNzUuNjU0eiBNMTY5LjMwMSwzOS42NzhjMS4zMzEtMS43MTIsMi45NS0yLjc2Miw0Ljg1My0zLjE0aDkwLjUwNCAgICBjMS45MDMsMC4zODEsMy41MjUsMS40Myw0Ljg1NCwzLjE0bDEzLjcwOSwzMy40MDRIMTU1LjMxMUwxNjkuMzAxLDM5LjY3OHogTTM0Ny4xNzMsMzgwLjI5MWMwLDQuMTg2LTAuNjY0LDguMDQyLTEuOTk5LDExLjU2MSAgICBjLTEuMzM0LDMuNTE4LTIuNzE3LDYuMDg4LTQuMTQxLDcuNzA2Yy0xLjQzMSwxLjYyMi0yLjQyMywyLjQyNy0yLjk5OCwyLjQyN0gxMDAuNDkzYy0wLjU3MSwwLTEuNTY1LTAuODA1LTIuOTk2LTIuNDI3ICAgIGMtMS40MjktMS42MTgtMi44MS00LjE4OC00LjE0My03LjcwNmMtMS4zMzEtMy41MTktMS45OTctNy4zNzktMS45OTctMTEuNTYxVjEwOS42MjdoMjU1LjgxNVYzODAuMjkxeiIgZmlsbD0iI2ZmOWNhZSIvPgoJCTxwYXRoIGQ9Ik0xMzcuMDQsMzQ3LjE3MmgxOC4yNzFjMi42NjcsMCw0Ljg1OC0wLjg1NSw2LjU2Ny0yLjU2N2MxLjcwOS0xLjcxOCwyLjU2OC0zLjkwMSwyLjU2OC02LjU3VjE3My41ODEgICAgYzAtMi42NjMtMC44NTktNC44NTMtMi41NjgtNi41NjdjLTEuNzE0LTEuNzA5LTMuODk5LTIuNTY1LTYuNTY3LTIuNTY1SDEzNy4wNGMtMi42NjcsMC00Ljg1NCwwLjg1NS02LjU2NywyLjU2NSAgICBjLTEuNzExLDEuNzE0LTIuNTY4LDMuOTA0LTIuNTY4LDYuNTY3djE2NC40NTRjMCwyLjY2OSwwLjg1NCw0Ljg1MywyLjU2OCw2LjU3QzEzMi4xODYsMzQ2LjMxNiwxMzQuMzczLDM0Ny4xNzIsMTM3LjA0LDM0Ny4xNzJ6IiBmaWxsPSIjZmY5Y2FlIi8+CgkJPHBhdGggZD0iTTIxMC4xMjksMzQ3LjE3MmgxOC4yNzFjMi42NjYsMCw0Ljg1Ni0wLjg1NSw2LjU2NC0yLjU2N2MxLjcxOC0xLjcxOCwyLjU2OS0zLjkwMSwyLjU2OS02LjU3VjE3My41ODEgICAgYzAtMi42NjMtMC44NTItNC44NTMtMi41NjktNi41NjdjLTEuNzA4LTEuNzA5LTMuODk4LTIuNTY1LTYuNTY0LTIuNTY1aC0xOC4yNzFjLTIuNjY0LDAtNC44NTQsMC44NTUtNi41NjcsMi41NjUgICAgYy0xLjcxNCwxLjcxNC0yLjU2OCwzLjkwNC0yLjU2OCw2LjU2N3YxNjQuNDU0YzAsMi42NjksMC44NTQsNC44NTMsMi41NjgsNi41N0MyMDUuMjc0LDM0Ni4zMTYsMjA3LjQ2NSwzNDcuMTcyLDIxMC4xMjksMzQ3LjE3MnogICAgIiBmaWxsPSIjZmY5Y2FlIi8+CgkJPHBhdGggZD0iTTI4My4yMiwzNDcuMTcyaDE4LjI2OGMyLjY2OSwwLDQuODU5LTAuODU1LDYuNTctMi41NjdjMS43MTEtMS43MTgsMi41NjItMy45MDEsMi41NjItNi41N1YxNzMuNTgxICAgIGMwLTIuNjYzLTAuODUyLTQuODUzLTIuNTYyLTYuNTY3Yy0xLjcxMS0xLjcwOS0zLjkwMS0yLjU2NS02LjU3LTIuNTY1SDI4My4yMmMtMi42NywwLTQuODUzLDAuODU1LTYuNTcxLDIuNTY1ICAgIGMtMS43MTEsMS43MTQtMi41NjYsMy45MDQtMi41NjYsNi41Njd2MTY0LjQ1NGMwLDIuNjY5LDAuODU1LDQuODUzLDIuNTY2LDYuNTdDMjc4LjM2NywzNDYuMzE2LDI4MC41NSwzNDcuMTcyLDI4My4yMiwzNDcuMTcyeiIgZmlsbD0iI2ZmOWNhZSIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=) no-repeat;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background: rgba(0, 255, 0, 0.1);
|
||||
height: 150px;
|
||||
padding: 25px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sidebar .grid-stack-item {
|
||||
width: 200px;
|
||||
height: 100px;
|
||||
border: 2px dashed green;
|
||||
text-align: center;
|
||||
line-height: 100px;
|
||||
z-index: 10;
|
||||
background: rgba(0, 255, 0, 0.1);
|
||||
cursor: default;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.sidebar .grid-stack-item .grid-stack-item-content {
|
||||
background: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<h1>Two grids demo</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="sidebar">
|
||||
<div class="grid-stack-item"><div class="grid-stack-item-content">Drag me</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="trash">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="grid-stack grid-stack-6" id="grid1">
|
||||
|
@ -58,10 +107,15 @@
|
|||
$(function () {
|
||||
var options = {
|
||||
width: 6,
|
||||
float: true
|
||||
float: false,
|
||||
removable: '.trash',
|
||||
removeTimeout: 100,
|
||||
acceptWidgets: '.grid-stack-item'
|
||||
};
|
||||
$('#grid1').gridstack(options);
|
||||
$('#grid2').gridstack(options);
|
||||
$('#grid2').gridstack(_.defaults({
|
||||
float: true
|
||||
}, options));
|
||||
|
||||
var items = [
|
||||
{x: 0, y: 0, width: 2, height: 2},
|
||||
|
@ -75,10 +129,17 @@
|
|||
var grid = $(this).data('gridstack');
|
||||
|
||||
_.each(items, function (node) {
|
||||
grid.add_widget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
grid.addWidget($('<div><div class="grid-stack-item-content" /><div/>'),
|
||||
node.x, node.y, node.width, node.height);
|
||||
}, this);
|
||||
});
|
||||
|
||||
$('.sidebar .grid-stack-item').draggable({
|
||||
revert: 'invalid',
|
||||
handle: '.grid-stack-item-content',
|
||||
scroll: false,
|
||||
appendTo: 'body'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
636
dist/gridstack-extra.css
vendored
636
dist/gridstack-extra.css
vendored
File diff suppressed because it is too large
Load diff
2
dist/gridstack-extra.min.css
vendored
2
dist/gridstack-extra.min.css
vendored
File diff suppressed because one or more lines are too long
41
dist/gridstack.all.js
vendored
Normal file
41
dist/gridstack.all.js
vendored
Normal file
File diff suppressed because one or more lines are too long
223
dist/gridstack.css
vendored
223
dist/gridstack.css
vendored
|
@ -5,6 +5,15 @@
|
|||
.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;
|
||||
|
@ -15,12 +24,15 @@
|
|||
bottom: 0;
|
||||
width: auto;
|
||||
z-index: 0 !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item {
|
||||
min-width: 8.33333333%;
|
||||
min-width: 8.3333333333%;
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .grid-stack-item-content {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
|
@ -33,6 +45,7 @@
|
|||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-handle {
|
||||
position: absolute;
|
||||
font-size: 0.1px;
|
||||
|
@ -40,43 +53,43 @@
|
|||
-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 {
|
||||
|
||||
.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 {
|
||||
text-align: right;
|
||||
color: gray;
|
||||
padding: 2px 3px 0 0;
|
||||
margin: 0;
|
||||
font: normal normal normal 10px/1 FontAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-se::before,
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-sw::before {
|
||||
content: "\f065";
|
||||
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 {
|
||||
display: inline-block;
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
-o-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
-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;
|
||||
|
@ -84,6 +97,7 @@
|
|||
left: 10px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-n {
|
||||
cursor: n-resize;
|
||||
height: 10px;
|
||||
|
@ -91,6 +105,7 @@
|
|||
left: 25px;
|
||||
right: 25px;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-ne {
|
||||
cursor: ne-resize;
|
||||
width: 20px;
|
||||
|
@ -98,6 +113,7 @@
|
|||
right: 10px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-e {
|
||||
cursor: e-resize;
|
||||
width: 10px;
|
||||
|
@ -105,6 +121,7 @@
|
|||
top: 15px;
|
||||
bottom: 15px;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-se {
|
||||
cursor: se-resize;
|
||||
width: 20px;
|
||||
|
@ -112,6 +129,7 @@
|
|||
right: 10px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-s {
|
||||
cursor: s-resize;
|
||||
height: 10px;
|
||||
|
@ -119,6 +137,7 @@
|
|||
bottom: 0;
|
||||
right: 25px;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-sw {
|
||||
cursor: sw-resize;
|
||||
width: 20px;
|
||||
|
@ -126,6 +145,7 @@
|
|||
left: 10px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-w {
|
||||
cursor: w-resize;
|
||||
width: 10px;
|
||||
|
@ -133,158 +153,215 @@
|
|||
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.33333333%;
|
||||
width: 8.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 8.33333333%;
|
||||
left: 8.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 8.33333333%;
|
||||
min-width: 8.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 8.33333333%;
|
||||
max-width: 8.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 16.66666667%;
|
||||
width: 16.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 16.66666667%;
|
||||
left: 16.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 16.66666667%;
|
||||
min-width: 16.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 16.66666667%;
|
||||
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.33333333%;
|
||||
width: 33.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 33.33333333%;
|
||||
left: 33.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 33.33333333%;
|
||||
min-width: 33.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 33.33333333%;
|
||||
max-width: 33.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 41.66666667%;
|
||||
width: 41.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 41.66666667%;
|
||||
left: 41.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 41.66666667%;
|
||||
min-width: 41.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 41.66666667%;
|
||||
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.33333333%;
|
||||
width: 58.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='7'] {
|
||||
left: 58.33333333%;
|
||||
left: 58.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='7'] {
|
||||
min-width: 58.33333333%;
|
||||
min-width: 58.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='7'] {
|
||||
max-width: 58.33333333%;
|
||||
max-width: 58.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-width='8'] {
|
||||
width: 66.66666667%;
|
||||
width: 66.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='8'] {
|
||||
left: 66.66666667%;
|
||||
left: 66.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='8'] {
|
||||
min-width: 66.66666667%;
|
||||
min-width: 66.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='8'] {
|
||||
max-width: 66.66666667%;
|
||||
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.33333333%;
|
||||
width: 83.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='10'] {
|
||||
left: 83.33333333%;
|
||||
left: 83.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='10'] {
|
||||
min-width: 83.33333333%;
|
||||
min-width: 83.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='10'] {
|
||||
max-width: 83.33333333%;
|
||||
max-width: 83.3333333333%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-width='11'] {
|
||||
width: 91.66666667%;
|
||||
width: 91.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-x='11'] {
|
||||
left: 91.66666667%;
|
||||
left: 91.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='11'] {
|
||||
min-width: 91.66666667%;
|
||||
min-width: 91.6666666667%;
|
||||
}
|
||||
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='11'] {
|
||||
max-width: 91.66666667%;
|
||||
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 {
|
||||
|
||||
.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 {
|
||||
|
||||
.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;
|
||||
|
@ -292,27 +369,19 @@
|
|||
transition: left 0s, top 0s, height 0s, width 0s;
|
||||
}
|
||||
|
||||
/** Uncomment this to show bottom-left resize handle **/
|
||||
/*
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-sw {
|
||||
display: inline-block;
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||
@include vendor(transform, rotate(180deg));
|
||||
.grid-stack.grid-stack-one-column-mode {
|
||||
height: auto !important;
|
||||
}
|
||||
*/
|
||||
@media (max-width: 768px) {
|
||||
.grid-stack-item {
|
||||
position: relative !important;
|
||||
width: auto !important;
|
||||
left: 0 !important;
|
||||
top: auto !important;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.grid-stack-item .ui-resizable-handle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.grid-stack {
|
||||
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;
|
||||
}
|
||||
|
|
97
dist/gridstack.jQueryUI.js
vendored
Normal file
97
dist/gridstack.jQueryUI.js
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* gridstack.js 0.3.0-dev
|
||||
* http://troolee.github.io/gridstack.js/
|
||||
* (c) 2014-2016 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 {
|
||||
el.resizable(_.extend({}, this.grid.opts.resizable, {
|
||||
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);
|
||||
if (opts === 'disable' || opts === 'enable') {
|
||||
el.droppable(opts);
|
||||
} else {
|
||||
el.droppable({
|
||||
accept: opts.accept
|
||||
});
|
||||
}
|
||||
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;
|
||||
});
|
13
dist/gridstack.jQueryUI.min.js
vendored
Normal file
13
dist/gridstack.jQueryUI.min.js
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* gridstack.js 0.3.0-dev
|
||||
* http://troolee.github.io/gridstack.js/
|
||||
* (c) 2014-2016 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){/**
|
||||
* @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 c.resizable(b.extend({},this.grid.opts.resizable,{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),"disable"===c||"enable"===c?b.droppable(c):b.droppable({accept:c.accept}),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
|
1710
dist/gridstack.js
vendored
1710
dist/gridstack.js
vendored
File diff suppressed because it is too large
Load diff
2
dist/gridstack.min.css
vendored
2
dist/gridstack.min.css
vendored
File diff suppressed because one or more lines are too long
30
dist/gridstack.min.js
vendored
30
dist/gridstack.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/gridstack.min.map
vendored
2
dist/gridstack.min.map
vendored
File diff suppressed because one or more lines are too long
51
doc/FAQ.md
Normal file
51
doc/FAQ.md
Normal file
|
@ -0,0 +1,51 @@
|
|||
Frequently asked questions
|
||||
==========================
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
|
||||
|
||||
- [Gridstack doesn't use bootstrap 3 classes. Why you say it's bootstrap 3 friendly.](#gridstack-doesnt-use-bootstrap-3-classes-why-you-say-its-bootstrap-3-friendly)
|
||||
- [How can I create a static layout using gridstack.](#how-can-i-create-a-static-layout-using-gridstack)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
### Gridstack doesn't use bootstrap 3 classes. Why you say it's bootstrap 3 friendly.
|
||||
|
||||
**Q:**
|
||||
|
||||
Original issue #390:
|
||||
|
||||
> Hi,
|
||||
>
|
||||
> Excuse my ignorance but on your site you write "responsive bootstrap v3 friendly layouts" but how?
|
||||
>
|
||||
> In none of the examples you actually make use of any bootstrap classes. You add it to head but if you do that with gridster it works exactly the same..
|
||||
>
|
||||
> What does gridstack do different then gridster?
|
||||
>
|
||||
> Reason I'm asking is because I have bootstrap HTML templates I want to put them in the grid so users can move it all around .. then when done have a normal html page (without the draggable grid). I thought gridstack would help to do that in favor of gridster but so far I have not seen any difference between the 2..
|
||||
>
|
||||
> Thanks!
|
||||
|
||||
**A:**
|
||||
|
||||
We never declare that gridstack uses bootstrap classes. We say that gridstack could be responsive (widgets are not fixed width) it works well on bootstrap 3 pages with fixed or responsive layout. That's why it says bootstrap 3 friendly.
|
||||
|
||||
It wasn't a goal for gridstack to create bootstrap 3 layouts. It's not a goal now neither. The goal of gridstack is to create dashboard layouts with draggable/resizable widgets.
|
||||
|
||||
Gridstack uses internal grid to implement its logic. DOM nodes are just interpretation of this grid. So we or you probably could create a third party library which exports this internal grid into bootstrap 3/bootstrap 4/absolute divs/whatever layout. But I don't see this as part of gridstack core. As the same as support of angular/knockout/whatever libraries. We're doing all necessary for smooth support but it will never be a part of core.
|
||||
|
||||
The main idea is to build as simple and flexible lib as possible.
|
||||
|
||||
|
||||
### How can I create a static layout using gridstack.
|
||||
|
||||
**Q:**
|
||||
|
||||
How can I create a static layout not using jQuery UI, etc.
|
||||
|
||||
**A:**
|
||||
|
||||
The main propose of gridstack is creating dashboards with draggable and/or resizable widgets. You could disable this behavior by setting `static` option. At this point you will probably
|
||||
still need to include jQuery UI. But we will try to decrease dependency of it in near future.
|
474
doc/README.md
Normal file
474
doc/README.md
Normal file
|
@ -0,0 +1,474 @@
|
|||
gridstack.js API
|
||||
================
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
|
||||
|
||||
- [Options](#options)
|
||||
- [Grid attributes](#grid-attributes)
|
||||
- [Item attributes](#item-attributes)
|
||||
- [Events](#events)
|
||||
- [added(event, items)](#addedevent-items)
|
||||
- [change(event, items)](#changeevent-items)
|
||||
- [disable(event)](#disableevent)
|
||||
- [dragstart(event, ui)](#dragstartevent-ui)
|
||||
- [dragstop(event, ui)](#dragstopevent-ui)
|
||||
- [enable(event)](#enableevent)
|
||||
- [removed(event, items)](#removedevent-items)
|
||||
- [resizestart(event, ui)](#resizestartevent-ui)
|
||||
- [resizestop(event, ui)](#resizestopevent-ui)
|
||||
- [API](#api)
|
||||
- [addWidget(el[, x, y, width, height, autoPosition, minWidth, maxWidth, minHeight, maxHeight, id])](#addwidgetel-x-y-width-height-autoposition-minwidth-maxwidth-minheight-maxheight-id)
|
||||
- [batchUpdate()](#batchupdate)
|
||||
- [cellHeight()](#cellheight)
|
||||
- [cellHeight(val)](#cellheightval)
|
||||
- [cellWidth()](#cellwidth)
|
||||
- [commit()](#commit)
|
||||
- [destroy([detachGrid])](#destroydetachgrid)
|
||||
- [disable()](#disable)
|
||||
- [enable()](#enable)
|
||||
- [enableMove(doEnable, includeNewWidgets)](#enablemovedoenable-includenewwidgets)
|
||||
- [enableResize(doEnable, includeNewWidgets)](#enableresizedoenable-includenewwidgets)
|
||||
- [getCellFromPixel(position[, useOffset])](#getcellfrompixelposition-useoffset)
|
||||
- [isAreaEmpty(x, y, width, height)](#isareaemptyx-y-width-height)
|
||||
- [locked(el, val)](#lockedel-val)
|
||||
- [makeWidget(el)](#makewidgetel)
|
||||
- [maxHeight(el, val)](#maxheightel-val)
|
||||
- [minHeight(el, val)](#minheightel-val)
|
||||
- [maxWidth(el, val)](#maxwidthel-val)
|
||||
- [minWidth(el, val)](#minwidthel-val)
|
||||
- [movable(el, val)](#movableel-val)
|
||||
- [move(el, x, y)](#moveel-x-y)
|
||||
- [removeWidget(el[, detachNode])](#removewidgetel-detachnode)
|
||||
- [removeAll([detachNode])](#removealldetachnode)
|
||||
- [resize(el, width, height)](#resizeel-width-height)
|
||||
- [resizable(el, val)](#resizableel-val)
|
||||
- [setAnimation(doAnimate)](#setanimationdoanimate)
|
||||
- [setGridWidth(gridWidth, doNotPropagate)](#setgridwidthgridwidth-donotpropagate)
|
||||
- [setStatic(staticValue)](#setstaticstaticvalue)
|
||||
- [update(el, x, y, width, height)](#updateel-x-y-width-height)
|
||||
- [verticalMargin(value, noUpdate)](#verticalmarginvalue-noupdate)
|
||||
- [willItFit(x, y, width, height, autoPosition)](#willitfitx-y-width-height-autoposition)
|
||||
- [Utils](#utils)
|
||||
- [GridStackUI.Utils.sort(nodes[, dir[, width]])](#gridstackuiutilssortnodes-dir-width)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Options
|
||||
|
||||
- `acceptWidgets` - if `true` of jquery selector the grid will accept widgets dragged from other grids or from
|
||||
outside (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/two.html)
|
||||
- `alwaysShowResizeHandle` - if `true` the resizing handles are shown even if the user is not hovering over the widget
|
||||
(default: `false`)
|
||||
- `animate` - turns animation on (default: `false`)
|
||||
- `auto` - if `false` gridstack will not initialize existing items (default: `true`)
|
||||
- `cellHeight` - one cell height (default: `60`). Can be:
|
||||
- an integer (px)
|
||||
- a string (ex: '10em', '100px', '10rem')
|
||||
- 0 or null, in which case the library will not generate styles for rows. Everything must be defined in CSS files.
|
||||
- `'auto'` - height will be calculated from cell width.
|
||||
- `ddPlugin` - class that implement drag'n'drop functionallity for gridstack. If `false` grid will be static. (default: `null` - first available plugin will be used)
|
||||
- `disableDrag` - disallows dragging of widgets (default: `false`).
|
||||
- `disableResize` - disallows resizing of widgets (default: `false`).
|
||||
- `draggable` - allows to override jQuery UI draggable options. (default: `{handle: '.grid-stack-item-content', scroll: false, appendTo: 'body'}`)
|
||||
- `handle` - draggable handle selector (default: `'.grid-stack-item-content'`)
|
||||
- `handleClass` - draggable handle class (e.g. `'grid-stack-item-content'`). If set `handle` is ignored (default: `null`)
|
||||
- `height` - maximum rows amount. Default is `0` which means no maximum rows
|
||||
- `float` - enable floating widgets (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/float.html)
|
||||
- `itemClass` - widget class (default: `'grid-stack-item'`)
|
||||
- `minWidth` - minimal width. If window width is less, grid will be shown in one-column mode (default: `768`)
|
||||
- `oneColumnModeClass` - class set on grid when in one column mode (default: 'grid-stack-one-column-mode')
|
||||
- `placeholderClass` - class for placeholder (default: `'grid-stack-placeholder'`)
|
||||
- `placeholderText` - placeholder default content (default: `''`)
|
||||
- `resizable` - allows to override jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`)
|
||||
- `removable` - if `true` widgets could be removed by dragging outside of the grid. It could also be a jQuery selector string, in this case widgets will be removed by dropping them there (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/two.html)
|
||||
- `removeTimeout` - time in milliseconds before widget is being removed while dragging outside of the grid. (default: `2000`)
|
||||
- `rtl` - if `true` turns grid to RTL. Possible values are `true`, `false`, `'auto'` (default: `'auto'`) See [example](http://troolee.github.io/gridstack.js/demo/rtl.html)
|
||||
- `staticGrid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.
|
||||
- `verticalMargin` - vertical gap size (default: `20`). Can be:
|
||||
- an integer (px)
|
||||
- a string (ex: '2em', '20px', '2rem')
|
||||
- `width` - amount of columns (default: `12`)
|
||||
|
||||
## Grid attributes
|
||||
|
||||
- `data-gs-animate` - turns animation on
|
||||
- `data-gs-width` - amount of columns
|
||||
- `data-gs-height` - maximum rows amount. Default is `0` which means no maximum rows.
|
||||
- `data-gs-current-height` - current rows amount. Set by the library only. Can be used by the CSS rules.
|
||||
|
||||
## Item attributes
|
||||
|
||||
- `data-gs-x`, `data-gs-y` - element position
|
||||
- `data-gs-width`, `data-gs-height` - element size
|
||||
- `data-gs-max-width`, `data-gs-min-width`, `data-gs-max-height`, `data-gs-min-height` - element constraints
|
||||
- `data-gs-no-resize` - disable element resizing
|
||||
- `data-gs-no-move` - disable element moving
|
||||
- `data-gs-auto-position` - tells to ignore `data-gs-x` and `data-gs-y` attributes and to place element to the first
|
||||
available position
|
||||
- `data-gs-locked` - the widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing.
|
||||
The widget can still be dragged or resized. You need to add `data-gs-no-resize` and `data-gs-no-move` attributes
|
||||
to completely lock the widget.
|
||||
|
||||
## Events
|
||||
|
||||
### added(event, items)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('added', function(event, items) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
console.log('item added');
|
||||
console.log(items[i]);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### change(event, items)
|
||||
|
||||
Occurs when adding/removing widgets or existing widgets change their position/size
|
||||
|
||||
```javascript
|
||||
var serializeWidgetMap = function(items) {
|
||||
console.log(items);
|
||||
};
|
||||
|
||||
$('.grid-stack').on('change', function(event, items) {
|
||||
serializeWidgetMap(items);
|
||||
});
|
||||
```
|
||||
|
||||
### disable(event)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('disable', function(event) {
|
||||
var grid = event.target;
|
||||
});
|
||||
```
|
||||
|
||||
### dragstart(event, ui)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('dragstart', function(event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
|
||||
### dragstop(event, ui)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('dragstop', function(event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
|
||||
### enable(event)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('enable', function(event) {
|
||||
var grid = event.target;
|
||||
});
|
||||
```
|
||||
|
||||
### removed(event, items)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('removed', function(event, items) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
console.log('item removed');
|
||||
console.log(items[i]);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### resizestart(event, ui)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('resizestart', function(event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
|
||||
### resizestop(event, ui)
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').on('resizestop', function(event, ui) {
|
||||
var grid = this;
|
||||
var element = event.target;
|
||||
});
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### addWidget(el[, x, y, width, height, autoPosition, minWidth, maxWidth, minHeight, maxHeight, id])
|
||||
|
||||
Creates new widget and returns it.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to add
|
||||
- `x`, `y`, `width`, `height` - widget position/dimensions (optional)
|
||||
- `autoPosition` - if `true` then `x`, `y` parameters will be ignored and widget will be places on the first available
|
||||
position (optional)
|
||||
- `minWidth` minimum width allowed during resize/creation (optional)
|
||||
- `maxWidth` maximum width allowed during resize/creation (optional)
|
||||
- `minHeight` minimum height allowed during resize/creation (optional)
|
||||
- `maxHeight` maximum height allowed during resize/creation (optional)
|
||||
- `id` value for `data-gs-id` (optional)
|
||||
|
||||
Widget will be always placed even if result height is more than actual grid height. You need to use `willItFit` method
|
||||
before calling `addWidget` for additional check.
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').gridstack();
|
||||
|
||||
var grid = $('.grid-stack').data('gridstack');
|
||||
grid.addWidget(el, 0, 0, 3, 2, true);
|
||||
```
|
||||
|
||||
### batchUpdate()
|
||||
|
||||
Initailizes batch updates. You will see no changes until `commit` method is called.
|
||||
|
||||
### cellHeight()
|
||||
|
||||
Gets current cell height.
|
||||
|
||||
### cellHeight(val)
|
||||
|
||||
Update current cell height. This method rebuilds an internal CSS stylesheet. Note: You can expect performance issues if
|
||||
call this method too often.
|
||||
|
||||
```javascript
|
||||
grid.cellHeight(grid.cellWidth() * 1.2);
|
||||
```
|
||||
|
||||
### cellWidth()
|
||||
|
||||
Gets current cell width.
|
||||
|
||||
### commit()
|
||||
|
||||
Finishes batch updates. Updates DOM nodes. You must call it after `batchUpdate`.
|
||||
|
||||
### destroy([detachGrid])
|
||||
|
||||
Destroys a grid instance.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `detachGrid` - if `false` nodes and grid will not be removed from the DOM (Optional. Default `true`).
|
||||
|
||||
### disable()
|
||||
|
||||
Disables widgets moving/resizing. This is a shortcut for:
|
||||
|
||||
```javascript
|
||||
grid.movable('.grid-stack-item', false);
|
||||
grid.resizable('.grid-stack-item', false);
|
||||
```
|
||||
|
||||
### enable()
|
||||
|
||||
Enables widgets moving/resizing. This is a shortcut for:
|
||||
|
||||
```javascript
|
||||
grid.movable('.grid-stack-item', true);
|
||||
grid.resizable('.grid-stack-item', true);
|
||||
```
|
||||
|
||||
### enableMove(doEnable, includeNewWidgets)
|
||||
|
||||
Enables/disables widget moving. `includeNewWidgets` will force new widgets to be draggable as per `doEnable`'s value by changing the `disableDrag` grid option. This is a shortcut for:
|
||||
|
||||
```javascript
|
||||
grid.movable(this.container.children('.' + this.opts.itemClass), doEnable);
|
||||
```
|
||||
|
||||
### enableResize(doEnable, includeNewWidgets)
|
||||
|
||||
Enables/disables widget resizing. `includeNewWidgets` will force new widgets to be resizable as per `doEnable`'s value by changing the `disableResize` grid option. This is a shortcut for:
|
||||
|
||||
```javascript
|
||||
grid.resizable(this.container.children('.' + this.opts.itemClass), doEnable);
|
||||
```
|
||||
|
||||
### getCellFromPixel(position[, useOffset])
|
||||
|
||||
Get the position of the cell under a pixel on screen.
|
||||
|
||||
Parameters :
|
||||
|
||||
- `position` - the position of the pixel to resolve in absolute coordinates, as an object with `top` and `left` properties
|
||||
- `useOffset` - if `true`, value will be based on offset vs position (Optional. Default `false`). Useful when grid is within `position: relative` element.
|
||||
|
||||
Returns an object with properties `x` and `y` i.e. the column and row in the grid.
|
||||
|
||||
### isAreaEmpty(x, y, width, height)
|
||||
|
||||
Checks if specified area is empty.
|
||||
|
||||
### locked(el, val)
|
||||
|
||||
Locks/unlocks widget.
|
||||
|
||||
- `el` - widget to modify.
|
||||
- `val` - if `true` widget will be locked.
|
||||
|
||||
### makeWidget(el)
|
||||
|
||||
If you add elements to your gridstack container by hand, you have to tell gridstack afterwards to make them widgets. If you want gridstack to add the elements for you, use `addWidget` instead.
|
||||
Makes the given element a widget and returns it.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - element to convert to a widget
|
||||
|
||||
```javascript
|
||||
$('.grid-stack').gridstack();
|
||||
|
||||
$('.grid-stack').append('<div id="gsi-1" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="2" data-gs-auto-position="1"></div>')
|
||||
var grid = $('.grid-stack').data('gridstack');
|
||||
grid.makeWidget('gsi-1');
|
||||
```
|
||||
|
||||
### maxHeight(el, val)
|
||||
|
||||
Set the `maxHeight` for a widget.
|
||||
|
||||
- `el` - widget to modify.
|
||||
- `val` - A numeric value of the number of rows
|
||||
|
||||
### minHeight(el, val)
|
||||
|
||||
Set the `minHeight` for a widget.
|
||||
|
||||
- `el` - widget to modify.
|
||||
- `val` - A numeric value of the number of rows
|
||||
|
||||
### maxWidth(el, val)
|
||||
|
||||
Set the `maxWidth` for a widget.
|
||||
|
||||
- `el` - widget to modify.
|
||||
- `val` - A numeric value of the number of columns
|
||||
|
||||
### minWidth(el, val)
|
||||
|
||||
Set the `minWidth` for a widget.
|
||||
|
||||
- `el` - widget to modify.
|
||||
- `val` - A numeric value of the number of columns
|
||||
|
||||
### movable(el, val)
|
||||
|
||||
Enables/Disables moving.
|
||||
|
||||
- `el` - widget to modify
|
||||
- `val` - if `true` widget will be draggable.
|
||||
|
||||
### move(el, x, y)
|
||||
|
||||
Changes widget position
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to move
|
||||
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
|
||||
|
||||
### removeWidget(el[, detachNode])
|
||||
|
||||
Removes widget from the grid.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to remove.
|
||||
- `detachNode` - if `false` node won't be removed from the DOM (Optional. Default `true`).
|
||||
|
||||
### removeAll([detachNode])
|
||||
|
||||
Removes all widgets from the grid.
|
||||
|
||||
Parameters:
|
||||
|
||||
- `detachNode` - if `false` nodes won't be removed from the DOM (Optional. Default `true`).
|
||||
|
||||
### resize(el, width, height)
|
||||
|
||||
Changes widget size
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to resize
|
||||
- `width`, `height` - new dimensions. If value is `null` or `undefined` it will be ignored.
|
||||
|
||||
### resizable(el, val)
|
||||
|
||||
Enables/Disables resizing.
|
||||
|
||||
- `el` - widget to modify
|
||||
- `val` - if `true` widget will be resizable.
|
||||
|
||||
### setAnimation(doAnimate)
|
||||
|
||||
Toggle the grid animation state. Toggles the `grid-stack-animate` class.
|
||||
|
||||
- `doAnimate` - if `true` the grid will animate.
|
||||
|
||||
### setGridWidth(gridWidth, doNotPropagate)
|
||||
|
||||
(Experimental) Modify number of columns in the grid. Will attempt to update existing widgets to conform to new number of columns. Requires `gridstack-extra.css` or `gridstack-extra.min.css`.
|
||||
|
||||
- `gridWidth` - Integer between 1 and 12.
|
||||
- `doNotPropagate` - if true existing widgets will not be updated.
|
||||
|
||||
### setStatic(staticValue)
|
||||
|
||||
Toggle the grid static state. Also toggle the `grid-stack-static` class.
|
||||
|
||||
- `staticValue` - if `true` the grid becomes static.
|
||||
|
||||
### update(el, x, y, width, height)
|
||||
|
||||
Parameters:
|
||||
|
||||
- `el` - widget to move
|
||||
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
|
||||
- `width`, `height` - new dimensions. If value is `null` or `undefined` it will be ignored.
|
||||
|
||||
Updates widget position/size.
|
||||
|
||||
### verticalMargin(value, noUpdate)
|
||||
|
||||
Parameters:
|
||||
|
||||
- `value` - new vertical margin value.
|
||||
- `noUpdate` - if true, styles will not be updated.
|
||||
|
||||
### willItFit(x, y, width, height, autoPosition)
|
||||
|
||||
Returns `true` if the `height` of the grid will be less the vertical constraint. Always returns `true` if grid doesn't
|
||||
have `height` constraint.
|
||||
|
||||
```javascript
|
||||
if (grid.willItFit(newNode.x, newNode.y, newNode.width, newNode.height, true)) {
|
||||
grid.addWidget(newNode.el, newNode.x, newNode.y, newNode.width, newNode.height, true);
|
||||
}
|
||||
else {
|
||||
alert('Not enough free space to place the widget');
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Utils
|
||||
|
||||
### GridStackUI.Utils.sort(nodes[, dir[, width]])
|
||||
|
||||
Sorts array of nodes
|
||||
|
||||
- `nodes` - array to sort
|
||||
- `dir` - `1` for asc, `-1` for desc (optional)
|
||||
- `width` - width of the grid. If `undefined` the width will be calculated automatically (optional).
|
81
karma.conf.js
Normal file
81
karma.conf.js
Normal file
|
@ -0,0 +1,81 @@
|
|||
// Karma configuration
|
||||
// Generated on Thu Feb 18 2016 22:00:23 GMT+0100 (CET)
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'bower_components/jquery/dist/jquery.min.js',
|
||||
'bower_components/jquery-ui/jquery-ui.min.js',
|
||||
'bower_components/lodash/dist/lodash.min.js',
|
||||
'src/gridstack.js',
|
||||
'src/gridstack.jQueryUI.js',
|
||||
'spec/*-spec.js'
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
],
|
||||
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'src/gridstack.js': ['coverage'],
|
||||
'src/gridstack.jQueryUI.js': ['coverage'],
|
||||
},
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress', 'coverage', 'coveralls'],
|
||||
|
||||
coverageReporter: {
|
||||
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
|
||||
dir: 'coverage/'
|
||||
},
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN
|
||||
// config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: true,
|
||||
|
||||
// Concurrency level
|
||||
// how many browser should be started simultaneous
|
||||
concurrency: Infinity
|
||||
});
|
||||
}
|
58
package.json
Normal file
58
package.json
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"name": "gridstack",
|
||||
"version": "0.3.0-dev",
|
||||
"description": "gridstack.js is a jQuery plugin for widget layout",
|
||||
"main": "dist/gridstack.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/troolee/gridstack.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "grunt",
|
||||
"test": "karma start karma.conf.js"
|
||||
},
|
||||
"keywords": [
|
||||
"gridstack",
|
||||
"grid",
|
||||
"gridster",
|
||||
"layout",
|
||||
"jquery"
|
||||
],
|
||||
"author": "Pavel Reznikov <pashka.reznikov@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/troolee/gridstack.js/issues"
|
||||
},
|
||||
"homepage": "http://troolee.github.io/gridstack.js/",
|
||||
"dependencies": {
|
||||
"jquery": "^3.1.0",
|
||||
"jquery-ui": "^1.12.0",
|
||||
"lodash": "^4.14.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"connect": "^3.4.1",
|
||||
"coveralls": "^2.11.8",
|
||||
"doctoc": "^1.0.0",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-cli": "^1.2.0",
|
||||
"grunt-contrib-connect": "^0.11.2",
|
||||
"grunt-contrib-copy": "^0.8.2",
|
||||
"grunt-contrib-cssmin": "^0.14.0",
|
||||
"grunt-contrib-jshint": "^1.0.0",
|
||||
"grunt-contrib-uglify": "^0.11.1",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-doctoc": "^0.1.1",
|
||||
"grunt-jscs": "^2.8.0",
|
||||
"grunt-protractor-runner": "^3.2.0",
|
||||
"grunt-protractor-webdriver": "^0.2.5",
|
||||
"grunt-sass": "^1.1.0",
|
||||
"jasmine-core": "^2.4.1",
|
||||
"karma": "^1.1.2",
|
||||
"karma-coverage": "^1.1.1",
|
||||
"karma-coveralls": "^1.1.2",
|
||||
"karma-jasmine": "^1.0.2",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"phantomjs-prebuilt": "^2.1.5",
|
||||
"serve-static": "^1.10.2"
|
||||
}
|
||||
}
|
12
protractor.conf.js
Normal file
12
protractor.conf.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
exports.config = {
|
||||
seleniumAddress: 'http://localhost:4444/wd/hub',
|
||||
specs: ['spec/e2e/*-spec.js'],
|
||||
capabilities: {
|
||||
browserName: 'firefox',
|
||||
version: '',
|
||||
platform: 'ANY',
|
||||
loggingPrefs: {
|
||||
browser: 'SEVERE'
|
||||
}
|
||||
},
|
||||
};
|
24
spec/e2e/gridstack-spec.js
Normal file
24
spec/e2e/gridstack-spec.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
describe('gridstack.js with height', function() {
|
||||
beforeAll(function() {
|
||||
browser.ignoreSynchronization = true;
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
browser.get('http://localhost:8080/spec/e2e/html/gridstack-with-height.html');
|
||||
});
|
||||
|
||||
it('shouldn\'t throw exeption when dragging widget outside the grid', function() {
|
||||
var widget = element(by.id('item-1'));
|
||||
var gridContainer = element(by.id('grid'));
|
||||
|
||||
browser.actions()
|
||||
.mouseDown(widget, {x: 20, y: 20})
|
||||
.mouseMove(gridContainer, {x: 300, y: 20})
|
||||
.mouseUp()
|
||||
.perform();
|
||||
|
||||
browser.manage().logs().get('browser').then(function(browserLog) {
|
||||
expect(browserLog.length).toEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
73
spec/e2e/html/gridstack-with-height.html
Normal file
73
spec/e2e/html/gridstack-with-height.html
Normal file
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>gridstack.js tests</title>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="../../../dist/gridstack.css"/>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js"></script>
|
||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
|
||||
<script src="../../../dist/gridstack.js"></script>
|
||||
<script src="../../../dist/gridstack.jQueryUI.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.grid-stack {
|
||||
background: lightgoldenrodyellow;
|
||||
}
|
||||
|
||||
.grid-stack-item-content {
|
||||
color: #2c3e50;
|
||||
text-align: center;
|
||||
background-color: #18bc9c;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<h1>gridstack.js tests</h1>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="grid-stack" id="grid">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var options = {
|
||||
height: 5
|
||||
};
|
||||
$('.grid-stack').gridstack(options);
|
||||
|
||||
new function() {
|
||||
var items = [
|
||||
{x: 0, y: 0, width: 2, height: 2},
|
||||
{x: 2, y: 5, width: 1, height: 1}
|
||||
];
|
||||
|
||||
this.grid = $('.grid-stack').data('gridstack');
|
||||
this.grid.removeAll();
|
||||
items = GridStackUI.Utils.sort(items);
|
||||
var id = 0;
|
||||
_.each(items, function(node) {
|
||||
var w = $('<div><div class="grid-stack-item-content" /><div/>');
|
||||
w.attr('id', 'item-' + (++id));
|
||||
this.grid.addWidget(w,
|
||||
node.x, node.y, node.width, node.height);
|
||||
}, this);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
311
spec/gridstack-engine-spec.js
Normal file
311
spec/gridstack-engine-spec.js
Normal file
|
@ -0,0 +1,311 @@
|
|||
describe('gridstack engine', function() {
|
||||
'use strict';
|
||||
|
||||
var e;
|
||||
var w;
|
||||
|
||||
beforeEach(function() {
|
||||
w = window;
|
||||
e = w.GridStackUI.Engine;
|
||||
});
|
||||
|
||||
describe('test constructor', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12);
|
||||
});
|
||||
|
||||
it('should be setup properly', function() {
|
||||
expect(engine.width).toEqual(12);
|
||||
expect(engine.float).toEqual(false);
|
||||
expect(engine.height).toEqual(0);
|
||||
expect(engine.nodes).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test _prepareNode', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12);
|
||||
});
|
||||
|
||||
it('should prepare a node', function() {
|
||||
expect(engine._prepareNode({}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({x: 10}, false)).toEqual(jasmine.objectContaining({x: 10, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({x: -10}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({y: 10}, false)).toEqual(jasmine.objectContaining({x: 0, y: 10, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({y: -10}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({width: 3}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 3, height: 1}));
|
||||
expect(engine._prepareNode({width: 100}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 12, height: 1}));
|
||||
expect(engine._prepareNode({width: 0}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({width: -190}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({height: 3}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 3}));
|
||||
expect(engine._prepareNode({height: 0}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({height: -10}, false)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(engine._prepareNode({x: 4, width: 10}, false)).toEqual(jasmine.objectContaining({x: 2, y: 0, width: 10, height: 1}));
|
||||
expect(engine._prepareNode({x: 4, width: 10}, true)).toEqual(jasmine.objectContaining({x: 4, y: 0, width: 8, height: 1}));
|
||||
});
|
||||
});
|
||||
|
||||
describe('test isAreaEmpty', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12, null, true);
|
||||
engine.nodes = [
|
||||
engine._prepareNode({x: 3, y: 2, width: 3, height: 2})
|
||||
];
|
||||
});
|
||||
|
||||
it('should be true', function() {
|
||||
expect(engine.isAreaEmpty(0, 0, 3, 2)).toEqual(true);
|
||||
expect(engine.isAreaEmpty(3, 4, 3, 2)).toEqual(true);
|
||||
});
|
||||
|
||||
it('should be false', function() {
|
||||
expect(engine.isAreaEmpty(1, 1, 3, 2)).toEqual(false);
|
||||
expect(engine.isAreaEmpty(2, 3, 3, 2)).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test cleanNodes/getDirtyNodes', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12, null, true);
|
||||
engine.nodes = [
|
||||
engine._prepareNode({x: 0, y: 0, width: 1, height: 1, idx: 1, _dirty: true}),
|
||||
engine._prepareNode({x: 3, y: 2, width: 3, height: 2, idx: 2, _dirty: true}),
|
||||
engine._prepareNode({x: 3, y: 7, width: 3, height: 2, idx: 3})
|
||||
];
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
engine._updateCounter = 0;
|
||||
});
|
||||
|
||||
it('should return all dirty nodes', function() {
|
||||
var nodes = engine.getDirtyNodes();
|
||||
|
||||
expect(nodes.length).toEqual(2);
|
||||
expect(nodes[0].idx).toEqual(1);
|
||||
expect(nodes[1].idx).toEqual(2);
|
||||
});
|
||||
|
||||
it('should\'n clean nodes if _updateCounter > 0', function() {
|
||||
engine._updateCounter = 1;
|
||||
engine.cleanNodes();
|
||||
|
||||
expect(engine.getDirtyNodes().length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should clean all dirty nodes', function() {
|
||||
engine.cleanNodes();
|
||||
|
||||
expect(engine.getDirtyNodes().length).toEqual(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test batchUpdate/commit', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12);
|
||||
});
|
||||
|
||||
it('should work on not float grids', function() {
|
||||
expect(engine.float).toEqual(false);
|
||||
engine.batchUpdate();
|
||||
expect(engine._updateCounter).toBeGreaterThan(0);
|
||||
expect(engine.float).toEqual(true);
|
||||
engine.commit();
|
||||
expect(engine._updateCounter).toEqual(0);
|
||||
expect(engine.float).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test batchUpdate/commit', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12, null, true);
|
||||
});
|
||||
|
||||
it('should work on float grids', function() {
|
||||
expect(engine.float).toEqual(true);
|
||||
engine.batchUpdate();
|
||||
expect(engine._updateCounter).toBeGreaterThan(0);
|
||||
expect(engine.float).toEqual(true);
|
||||
engine.commit();
|
||||
expect(engine._updateCounter).toEqual(0);
|
||||
expect(engine.float).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test _notify', function() {
|
||||
var engine;
|
||||
var spy;
|
||||
|
||||
beforeEach(function() {
|
||||
spy = {
|
||||
callback: function() {}
|
||||
};
|
||||
spyOn(spy, 'callback');
|
||||
|
||||
engine = new GridStackUI.Engine(12, spy.callback, true);
|
||||
|
||||
engine.nodes = [
|
||||
engine._prepareNode({x: 0, y: 0, width: 1, height: 1, idx: 1, _dirty: true}),
|
||||
engine._prepareNode({x: 3, y: 2, width: 3, height: 2, idx: 2, _dirty: true}),
|
||||
engine._prepareNode({x: 3, y: 7, width: 3, height: 2, idx: 3})
|
||||
];
|
||||
});
|
||||
|
||||
it('should\'n be called if _updateCounter > 0', function() {
|
||||
engine._updateCounter = 1;
|
||||
engine._notify();
|
||||
|
||||
expect(spy.callback).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should by called with dirty nodes', function() {
|
||||
engine._notify();
|
||||
|
||||
expect(spy.callback).toHaveBeenCalledWith([
|
||||
engine.nodes[0],
|
||||
engine.nodes[1]
|
||||
], true);
|
||||
});
|
||||
|
||||
it('should by called with extra passed node to be removed', function() {
|
||||
var n1 = {idx: -1};
|
||||
|
||||
engine._notify(n1);
|
||||
|
||||
expect(spy.callback).toHaveBeenCalledWith([
|
||||
n1,
|
||||
engine.nodes[0],
|
||||
engine.nodes[1]
|
||||
], true);
|
||||
});
|
||||
|
||||
it('should by called with extra passed node to be removed and should maintain false parameter', function() {
|
||||
var n1 = {idx: -1};
|
||||
|
||||
engine._notify(n1, false);
|
||||
|
||||
expect(spy.callback).toHaveBeenCalledWith([
|
||||
n1,
|
||||
engine.nodes[0],
|
||||
engine.nodes[1]
|
||||
], false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test _packNodes', function() {
|
||||
describe('using not float mode', function() {
|
||||
var engine;
|
||||
|
||||
var findNode = function(engine, id) {
|
||||
return _.find(engine.nodes, function(i) { return i._id === id; });
|
||||
};
|
||||
|
||||
beforeEach(function() {
|
||||
engine = new GridStackUI.Engine(12, null, false);
|
||||
});
|
||||
|
||||
it('shouldn\'t pack one node with y coord eq 0', function() {
|
||||
engine.nodes = [
|
||||
{x: 0, y: 0, width: 1, height: 1, _id: 1},
|
||||
];
|
||||
|
||||
engine._packNodes();
|
||||
|
||||
expect(findNode(engine, 1)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1}));
|
||||
expect(findNode(engine, 1)._dirty).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should pack one node correctly', function() {
|
||||
engine.nodes = [
|
||||
{x: 0, y: 1, width: 1, height: 1, _id: 1},
|
||||
];
|
||||
|
||||
engine._packNodes();
|
||||
|
||||
expect(findNode(engine, 1)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1, _dirty: true}));
|
||||
});
|
||||
|
||||
it('should pack nodes correctly', function() {
|
||||
engine.nodes = [
|
||||
{x: 0, y: 1, width: 1, height: 1, _id: 1},
|
||||
{x: 0, y: 5, width: 1, height: 1, _id: 2},
|
||||
];
|
||||
|
||||
engine._packNodes();
|
||||
|
||||
expect(findNode(engine, 1)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1, _dirty: true}));
|
||||
expect(findNode(engine, 2)).toEqual(jasmine.objectContaining({x: 0, y: 1, width: 1, height: 1, _dirty: true}));
|
||||
});
|
||||
|
||||
it('should pack nodes correctly', function() {
|
||||
engine.nodes = [
|
||||
{x: 0, y: 5, width: 1, height: 1, _id: 1},
|
||||
{x: 0, y: 1, width: 1, height: 1, _id: 2},
|
||||
];
|
||||
|
||||
engine._packNodes();
|
||||
|
||||
expect(findNode(engine, 2)).toEqual(jasmine.objectContaining({x: 0, y: 0, width: 1, height: 1, _dirty: true}));
|
||||
expect(findNode(engine, 1)).toEqual(jasmine.objectContaining({x: 0, y: 1, width: 1, height: 1, _dirty: true}));
|
||||
});
|
||||
|
||||
it('should respect locked nodes', function() {
|
||||
engine.nodes = [
|
||||
{x: 0, y: 1, width: 1, height: 1, _id: 1, locked: true},
|
||||
{x: 0, y: 5, width: 1, height: 1, _id: 2},
|
||||
];
|
||||
|
||||
engine._packNodes();
|
||||
|
||||
expect(findNode(engine, 1)).toEqual(jasmine.objectContaining({x: 0, y: 1, width: 1, height: 1}));
|
||||
expect(findNode(engine, 1)._dirty).toBeFalsy();
|
||||
expect(findNode(engine, 2)).toEqual(jasmine.objectContaining({x: 0, y: 2, width: 1, height: 1, _dirty: true}));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('test isNodeChangedPosition', function() {
|
||||
var engine;
|
||||
|
||||
beforeAll(function() {
|
||||
engine = new GridStackUI.Engine(12);
|
||||
});
|
||||
|
||||
it('should return true for changed x', function() {
|
||||
var widget = { x: 1, y: 2, width: 3, height: 4 };
|
||||
expect(engine.isNodeChangedPosition(widget, 2, 2)).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return true for changed y', function() {
|
||||
var widget = { x: 1, y: 2, width: 3, height: 4 };
|
||||
expect(engine.isNodeChangedPosition(widget, 1, 1)).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return true for changed width', function() {
|
||||
var widget = { x: 1, y: 2, width: 3, height: 4 };
|
||||
expect(engine.isNodeChangedPosition(widget, 2, 2, 4, 4)).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return true for changed height', function() {
|
||||
var widget = { x: 1, y: 2, width: 3, height: 4 };
|
||||
expect(engine.isNodeChangedPosition(widget, 1, 2, 3, 3)).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return false for unchanged position', function() {
|
||||
var widget = { x: 1, y: 2, width: 3, height: 4 };
|
||||
expect(engine.isNodeChangedPosition(widget, 1, 2, 3, 4)).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
1269
spec/gridstack-spec.js
Normal file
1269
spec/gridstack-spec.js
Normal file
File diff suppressed because it is too large
Load diff
109
spec/utils-spec.js
Normal file
109
spec/utils-spec.js
Normal file
|
@ -0,0 +1,109 @@
|
|||
describe('gridstack utils', function() {
|
||||
'use strict';
|
||||
|
||||
var utils;
|
||||
|
||||
beforeEach(function() {
|
||||
utils = window.GridStackUI.Utils;
|
||||
});
|
||||
|
||||
describe('setup of utils', function() {
|
||||
|
||||
it('should set gridstack utils.', function() {
|
||||
expect(utils).not.toBeNull();
|
||||
expect(typeof utils).toBe('object');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('test toBool', function() {
|
||||
|
||||
it('should return booleans.', function() {
|
||||
expect(utils.toBool(true)).toEqual(true);
|
||||
expect(utils.toBool(false)).toEqual(false);
|
||||
});
|
||||
|
||||
it('should work with integer.', function() {
|
||||
expect(utils.toBool(1)).toEqual(true);
|
||||
expect(utils.toBool(0)).toEqual(false);
|
||||
});
|
||||
|
||||
it('should work with Strings.', function() {
|
||||
expect(utils.toBool('')).toEqual(false);
|
||||
expect(utils.toBool('0')).toEqual(false);
|
||||
expect(utils.toBool('no')).toEqual(false);
|
||||
expect(utils.toBool('false')).toEqual(false);
|
||||
expect(utils.toBool('yes')).toEqual(true);
|
||||
expect(utils.toBool('yadda')).toEqual(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('test isIntercepted', function() {
|
||||
var src = {x: 3, y: 2, width: 3, height: 2};
|
||||
|
||||
it('should intercept.', function() {
|
||||
expect(utils.isIntercepted(src, {x: 0, y: 0, width: 4, height: 3})).toEqual(true);
|
||||
expect(utils.isIntercepted(src, {x: 0, y: 0, width: 40, height: 30})).toEqual(true);
|
||||
expect(utils.isIntercepted(src, {x: 3, y: 2, width: 3, height: 2})).toEqual(true);
|
||||
expect(utils.isIntercepted(src, {x: 5, y: 3, width: 3, height: 2})).toEqual(true);
|
||||
});
|
||||
|
||||
it('shouldn\'t intercept.', function() {
|
||||
expect(utils.isIntercepted(src, {x: 0, y: 0, width: 3, height: 2})).toEqual(false);
|
||||
expect(utils.isIntercepted(src, {x: 0, y: 0, width: 13, height: 2})).toEqual(false);
|
||||
expect(utils.isIntercepted(src, {x: 1, y: 4, width: 13, height: 2})).toEqual(false);
|
||||
expect(utils.isIntercepted(src, {x: 0, y: 3, width: 3, height: 2})).toEqual(false);
|
||||
expect(utils.isIntercepted(src, {x: 6, y: 3, width: 3, height: 2})).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('test createStylesheet/removeStylesheet', function() {
|
||||
|
||||
it('should create/remove style DOM', function() {
|
||||
var _id = 'test-123';
|
||||
|
||||
utils.createStylesheet(_id);
|
||||
|
||||
var style = $('STYLE[data-gs-style-id=' + _id + ']');
|
||||
|
||||
expect(style.length).toEqual(1);
|
||||
expect(style.prop('tagName')).toEqual('STYLE');
|
||||
|
||||
utils.removeStylesheet(_id)
|
||||
|
||||
style = $('STYLE[data-gs-style-id=' + _id + ']');
|
||||
|
||||
expect(style.length).toEqual(0);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('test parseHeight', function() {
|
||||
|
||||
it('should parse height value', function() {
|
||||
expect(utils.parseHeight(12)).toEqual(jasmine.objectContaining({height: 12, unit: 'px'}));
|
||||
expect(utils.parseHeight('12px')).toEqual(jasmine.objectContaining({height: 12, unit: 'px'}));
|
||||
expect(utils.parseHeight('12.3px')).toEqual(jasmine.objectContaining({height: 12.3, unit: 'px'}));
|
||||
expect(utils.parseHeight('12.3em')).toEqual(jasmine.objectContaining({height: 12.3, unit: 'em'}));
|
||||
expect(utils.parseHeight('12.3rem')).toEqual(jasmine.objectContaining({height: 12.3, unit: 'rem'}));
|
||||
expect(utils.parseHeight('12.3vh')).toEqual(jasmine.objectContaining({height: 12.3, unit: 'vh'}));
|
||||
expect(utils.parseHeight('12.3vw')).toEqual(jasmine.objectContaining({height: 12.3, unit: 'vw'}));
|
||||
expect(utils.parseHeight('12.5')).toEqual(jasmine.objectContaining({height: 12.5, unit: 'px'}));
|
||||
expect(function() { utils.parseHeight('12.5 df'); }).toThrowError('Invalid height');
|
||||
|
||||
});
|
||||
|
||||
it('should parse negative height value', function() {
|
||||
expect(utils.parseHeight(-12)).toEqual(jasmine.objectContaining({height: -12, unit: 'px'}));
|
||||
expect(utils.parseHeight('-12px')).toEqual(jasmine.objectContaining({height: -12, unit: 'px'}));
|
||||
expect(utils.parseHeight('-12.3px')).toEqual(jasmine.objectContaining({height: -12.3, unit: 'px'}));
|
||||
expect(utils.parseHeight('-12.3em')).toEqual(jasmine.objectContaining({height: -12.3, unit: 'em'}));
|
||||
expect(utils.parseHeight('-12.3rem')).toEqual(jasmine.objectContaining({height: -12.3, unit: 'rem'}));
|
||||
expect(utils.parseHeight('-12.3vh')).toEqual(jasmine.objectContaining({height: -12.3, unit: 'vh'}));
|
||||
expect(utils.parseHeight('-12.3vw')).toEqual(jasmine.objectContaining({height: -12.3, unit: 'vw'}));
|
||||
expect(utils.parseHeight('-12.5')).toEqual(jasmine.objectContaining({height: -12.5, unit: 'px'}));
|
||||
expect(function() { utils.parseHeight('-12.5 df'); }).toThrowError('Invalid height');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,983 +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.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='1'] {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-3 > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 66.66666667%;
|
||||
}
|
||||
.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.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='1'] {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 33.33333333%;
|
||||
}
|
||||
.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.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 83.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 83.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-6 > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 83.33333333%;
|
||||
}
|
||||
.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.28571429%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='1'] {
|
||||
width: 14.28571429%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 14.28571429%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 14.28571429%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 14.28571429%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 28.57142857%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 28.57142857%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 28.57142857%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 28.57142857%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='3'] {
|
||||
width: 42.85714286%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='3'] {
|
||||
left: 42.85714286%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='3'] {
|
||||
min-width: 42.85714286%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='3'] {
|
||||
max-width: 42.85714286%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='4'] {
|
||||
width: 57.14285714%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 57.14285714%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 57.14285714%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 57.14285714%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 71.42857143%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 71.42857143%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 71.42857143%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 71.42857143%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-width='6'] {
|
||||
width: 85.71428571%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-x='6'] {
|
||||
left: 85.71428571%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-min-width='6'] {
|
||||
min-width: 85.71428571%;
|
||||
}
|
||||
.grid-stack.grid-stack-7 > .grid-stack-item[data-gs-max-width='6'] {
|
||||
max-width: 85.71428571%;
|
||||
}
|
||||
.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.11111111%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='1'] {
|
||||
width: 11.11111111%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 11.11111111%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 11.11111111%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 11.11111111%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 22.22222222%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 22.22222222%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 22.22222222%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 22.22222222%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='3'] {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='3'] {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='3'] {
|
||||
min-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='3'] {
|
||||
max-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='4'] {
|
||||
width: 44.44444444%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 44.44444444%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 44.44444444%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 44.44444444%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 55.55555556%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 55.55555556%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 55.55555556%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 55.55555556%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='6'] {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='6'] {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='6'] {
|
||||
min-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='6'] {
|
||||
max-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='7'] {
|
||||
width: 77.77777778%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='7'] {
|
||||
left: 77.77777778%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='7'] {
|
||||
min-width: 77.77777778%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='7'] {
|
||||
max-width: 77.77777778%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-width='8'] {
|
||||
width: 88.88888889%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-x='8'] {
|
||||
left: 88.88888889%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-min-width='8'] {
|
||||
min-width: 88.88888889%;
|
||||
}
|
||||
.grid-stack.grid-stack-9 > .grid-stack-item[data-gs-max-width='8'] {
|
||||
max-width: 88.88888889%;
|
||||
}
|
||||
.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.09090909%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='1'] {
|
||||
width: 9.09090909%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 9.09090909%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 9.09090909%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 9.09090909%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 18.18181818%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 18.18181818%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 18.18181818%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 18.18181818%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='3'] {
|
||||
width: 27.27272727%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='3'] {
|
||||
left: 27.27272727%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='3'] {
|
||||
min-width: 27.27272727%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='3'] {
|
||||
max-width: 27.27272727%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='4'] {
|
||||
width: 36.36363636%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 36.36363636%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 36.36363636%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 36.36363636%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 45.45454545%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 45.45454545%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 45.45454545%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 45.45454545%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='6'] {
|
||||
width: 54.54545455%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='6'] {
|
||||
left: 54.54545455%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='6'] {
|
||||
min-width: 54.54545455%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='6'] {
|
||||
max-width: 54.54545455%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='7'] {
|
||||
width: 63.63636364%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='7'] {
|
||||
left: 63.63636364%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='7'] {
|
||||
min-width: 63.63636364%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='7'] {
|
||||
max-width: 63.63636364%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='8'] {
|
||||
width: 72.72727273%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='8'] {
|
||||
left: 72.72727273%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='8'] {
|
||||
min-width: 72.72727273%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='8'] {
|
||||
max-width: 72.72727273%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='9'] {
|
||||
width: 81.81818182%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='9'] {
|
||||
left: 81.81818182%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='9'] {
|
||||
min-width: 81.81818182%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='9'] {
|
||||
max-width: 81.81818182%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='10'] {
|
||||
width: 90.90909091%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='10'] {
|
||||
left: 90.90909091%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='10'] {
|
||||
min-width: 90.90909091%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='10'] {
|
||||
max-width: 90.90909091%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-width='11'] {
|
||||
width: 100.0%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-x='11'] {
|
||||
left: 100.0%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-min-width='11'] {
|
||||
min-width: 100.0%;
|
||||
}
|
||||
.grid-stack.grid-stack-11 > .grid-stack-item[data-gs-max-width='11'] {
|
||||
max-width: 100.0%;
|
||||
}
|
||||
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item {
|
||||
min-width: 8.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='1'] {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 8.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 8.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 8.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 16.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 16.66666667%;
|
||||
}
|
||||
.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.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 41.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 41.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 41.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 41.66666667%;
|
||||
}
|
||||
.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.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='7'] {
|
||||
left: 58.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='7'] {
|
||||
min-width: 58.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='7'] {
|
||||
max-width: 58.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='8'] {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='8'] {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='8'] {
|
||||
min-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='8'] {
|
||||
max-width: 66.66666667%;
|
||||
}
|
||||
.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.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='10'] {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='10'] {
|
||||
min-width: 83.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='10'] {
|
||||
max-width: 83.33333333%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-width='11'] {
|
||||
width: 91.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-x='11'] {
|
||||
left: 91.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-min-width='11'] {
|
||||
min-width: 91.66666667%;
|
||||
}
|
||||
.grid-stack.grid-stack-12 > .grid-stack-item[data-gs-max-width='11'] {
|
||||
max-width: 91.66666667%;
|
||||
}
|
||||
.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%;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
$gridstack-columns: 12;
|
||||
$gridstack-columns: 12 !default;
|
||||
|
||||
@mixin grid-stack-items($gridstack-columns) {
|
||||
.grid-stack.grid-stack-#{$gridstack-columns} {
|
||||
|
|
|
@ -1,318 +0,0 @@
|
|||
:root .grid-stack-item > .ui-resizable-handle {
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.grid-stack {
|
||||
position: relative;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.grid-stack > .grid-stack-item {
|
||||
min-width: 8.33333333%;
|
||||
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 {
|
||||
text-align: right;
|
||||
color: gray;
|
||||
padding: 2px 3px 0 0;
|
||||
margin: 0;
|
||||
font: normal normal normal 10px/1 FontAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-se::before,
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-sw::before {
|
||||
content: "\f065";
|
||||
}
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-se {
|
||||
display: inline-block;
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
-o-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.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[data-gs-width='1'] {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='1'] {
|
||||
left: 8.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='1'] {
|
||||
min-width: 8.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='1'] {
|
||||
max-width: 8.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-width='2'] {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='2'] {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='2'] {
|
||||
min-width: 16.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='2'] {
|
||||
max-width: 16.66666667%;
|
||||
}
|
||||
.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.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='4'] {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='4'] {
|
||||
min-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='4'] {
|
||||
max-width: 33.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-width='5'] {
|
||||
width: 41.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='5'] {
|
||||
left: 41.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='5'] {
|
||||
min-width: 41.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='5'] {
|
||||
max-width: 41.66666667%;
|
||||
}
|
||||
.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.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='7'] {
|
||||
left: 58.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='7'] {
|
||||
min-width: 58.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='7'] {
|
||||
max-width: 58.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-width='8'] {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='8'] {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='8'] {
|
||||
min-width: 66.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='8'] {
|
||||
max-width: 66.66666667%;
|
||||
}
|
||||
.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.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='10'] {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='10'] {
|
||||
min-width: 83.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='10'] {
|
||||
max-width: 83.33333333%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-width='11'] {
|
||||
width: 91.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-x='11'] {
|
||||
left: 91.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-min-width='11'] {
|
||||
min-width: 91.66666667%;
|
||||
}
|
||||
.grid-stack > .grid-stack-item[data-gs-max-width='11'] {
|
||||
max-width: 91.66666667%;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
/** Uncomment this to show bottom-left resize handle **/
|
||||
/*
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-sw {
|
||||
display: inline-block;
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||
@include vendor(transform, rotate(180deg));
|
||||
}
|
||||
*/
|
||||
@media (max-width: 768px) {
|
||||
.grid-stack-item {
|
||||
position: relative !important;
|
||||
width: auto !important;
|
||||
left: 0 !important;
|
||||
top: auto !important;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.grid-stack-item .ui-resizable-handle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.grid-stack {
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
97
src/gridstack.jQueryUI.js
Normal file
97
src/gridstack.jQueryUI.js
Normal file
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* gridstack.js 0.3.0-dev
|
||||
* http://troolee.github.io/gridstack.js/
|
||||
* (c) 2014-2016 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 {
|
||||
el.resizable(_.extend({}, this.grid.opts.resizable, {
|
||||
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);
|
||||
if (opts === 'disable' || opts === 'enable') {
|
||||
el.droppable(opts);
|
||||
} else {
|
||||
el.droppable({
|
||||
accept: opts.accept
|
||||
});
|
||||
}
|
||||
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;
|
||||
});
|
1710
src/gridstack.js
1710
src/gridstack.js
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
$gridstack-columns: 12;
|
||||
$horizontal_padding: 20px;
|
||||
$vertical_padding: 20px;
|
||||
$animation_speed: .3s;
|
||||
$gridstack-columns: 12 !default;
|
||||
$horizontal_padding: 20px !default;
|
||||
$vertical_padding: 20px !default;
|
||||
$animation_speed: .3s !default;
|
||||
|
||||
@mixin vendor($property, $value...){
|
||||
-webkit-#{$property}:$value;
|
||||
|
@ -16,6 +16,14 @@ $animation_speed: .3s;
|
|||
.grid-stack {
|
||||
position: relative;
|
||||
|
||||
&.grid-stack-rtl {
|
||||
direction: ltr;
|
||||
|
||||
> .grid-stack-item {
|
||||
direction: rtl;
|
||||
}
|
||||
}
|
||||
|
||||
.grid-stack-placeholder > .placeholder-content {
|
||||
border: 1px dashed lightgray;
|
||||
margin: 0;
|
||||
|
@ -26,6 +34,7 @@ $animation_speed: .3s;
|
|||
bottom: 0;
|
||||
width: auto;
|
||||
z-index: 0 !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
> .grid-stack-item {
|
||||
|
@ -53,44 +62,34 @@ $animation_speed: .3s;
|
|||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
|
||||
&.ui-resizable-disabled > .ui-resizable-handle,
|
||||
&.ui-resizable-autohide > .ui-resizable-handle { display: none; }
|
||||
|
||||
|
||||
&.ui-draggable-dragging,
|
||||
&.ui-resizable-resizing {
|
||||
z-index: 100;
|
||||
|
||||
|
||||
> .grid-stack-item-content,
|
||||
> .grid-stack-item-content {
|
||||
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
> .ui-resizable-se,
|
||||
> .ui-resizable-sw {
|
||||
text-align: right;
|
||||
color: gray;
|
||||
|
||||
padding: 2px 3px 0 0;
|
||||
margin: 0;
|
||||
|
||||
font: normal normal normal 10px/1 FontAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
&::before { content: "\f065"; }
|
||||
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
@include vendor(transform, rotate(45deg));
|
||||
}
|
||||
|
||||
|
||||
> .ui-resizable-se {
|
||||
display: inline-block;
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
||||
@include vendor(transform, rotate(90deg));
|
||||
@include vendor(transform, rotate(-45deg));
|
||||
}
|
||||
|
||||
|
||||
|
||||
> .ui-resizable-nw { cursor: nw-resize; width: 20px; height: 20px; left: 10px; top: 0; }
|
||||
> .ui-resizable-n { cursor: n-resize; height: 10px; top: 0; left: 25px; right: 25px; }
|
||||
> .ui-resizable-ne { cursor: ne-resize; width: 20px; height: 20px; right: 10px; top: 0; }
|
||||
|
@ -99,7 +98,13 @@ $animation_speed: .3s;
|
|||
> .ui-resizable-s { cursor: s-resize; height: 10px; left: 25px; bottom: 0; right: 25px; }
|
||||
> .ui-resizable-sw { cursor: sw-resize; width: 20px; height: 20px; left: 10px; bottom: 0; }
|
||||
> .ui-resizable-w { cursor: w-resize; width: 10px; left: $horizontal_padding / 2; top: 15px; bottom: 15px; }
|
||||
|
||||
|
||||
&.ui-draggable-dragging {
|
||||
&> .ui-resizable-handle {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@for $i from 1 through $gridstack-columns {
|
||||
&[data-gs-width='#{$i}'] { width: (100% / $gridstack-columns) * $i; }
|
||||
&[data-gs-x='#{$i}'] { left: (100% / $gridstack-columns) * $i; }
|
||||
|
@ -107,8 +112,8 @@ $animation_speed: .3s;
|
|||
&[data-gs-max-width='#{$i}'] { max-width: (100% / $gridstack-columns) * $i; }
|
||||
}
|
||||
}
|
||||
|
||||
&.grid-stack-animate,
|
||||
|
||||
&.grid-stack-animate,
|
||||
&.grid-stack-animate .grid-stack-item {
|
||||
@include vendor(transition, left $animation_speed, top $animation_speed, height $animation_speed, width $animation_speed);
|
||||
}
|
||||
|
@ -118,27 +123,18 @@ $animation_speed: .3s;
|
|||
&.grid-stack-animate .grid-stack-item.grid-stack-placeholder{
|
||||
@include vendor(transition, left .0s, top .0s, height .0s, width .0s);
|
||||
}
|
||||
}
|
||||
|
||||
&.grid-stack-one-column-mode {
|
||||
height: auto !important;
|
||||
&> .grid-stack-item {
|
||||
position: relative !important;
|
||||
width: auto !important;
|
||||
left: 0 !important;
|
||||
top: auto !important;
|
||||
margin-bottom: $vertical_padding;
|
||||
max-width: none !important;
|
||||
|
||||
/** Uncomment this to show bottom-left resize handle **/
|
||||
/*
|
||||
.grid-stack > .grid-stack-item > .ui-resizable-sw {
|
||||
display: inline-block;
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||
@include vendor(transform, rotate(180deg));
|
||||
}
|
||||
*/
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.grid-stack-item {
|
||||
position: relative !important;
|
||||
width: auto !important;
|
||||
left: 0 !important;
|
||||
top: auto !important;
|
||||
margin-bottom: $vertical_padding;
|
||||
|
||||
.ui-resizable-handle { display: none; }
|
||||
}
|
||||
|
||||
.grid-stack { height: auto !important; }
|
||||
&> .ui-resizable-handle { display: none; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue