Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
open-source
gridstack.js
Commits
93bedb44
Commit
93bedb44
authored
Mar 02, 2016
by
Pavel Reznikov
Browse files
Merge pull request #378 from troolee/tests/grid-height
Tests/grid height
parents
208a8baf
373c1eab
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
101 additions
and
7 deletions
+101
-7
dist/gridstack.js
dist/gridstack.js
+4
-0
dist/gridstack.min.js
dist/gridstack.min.js
+1
-1
dist/gridstack.min.map
dist/gridstack.min.map
+1
-1
protractor.conf.js
protractor.conf.js
+4
-1
spec/e2e/gridstack-spec.js
spec/e2e/gridstack-spec.js
+15
-4
spec/e2e/html/gridstack-with-height.html
spec/e2e/html/gridstack-with-height.html
+72
-0
src/gridstack.js
src/gridstack.js
+4
-0
No files found.
dist/gridstack.js
View file @
93bedb44
...
...
@@ -367,6 +367,10 @@
return
$
.
extend
({},
n
);
}));
if
(
typeof
clonedNode
===
'
undefined
'
)
{
return
true
;
}
clone
.
moveNode
(
clonedNode
,
x
,
y
,
width
,
height
);
var
res
=
true
;
...
...
dist/gridstack.min.js
View file @
93bedb44
This diff is collapsed.
Click to expand it.
dist/gridstack.min.map
View file @
93bedb44
This diff is collapsed.
Click to expand it.
protractor.conf.js
View file @
93bedb44
...
...
@@ -4,6 +4,9 @@ exports.config = {
capabilities
:
{
browserName
:
'
firefox
'
,
version
:
''
,
platform
:
'
ANY
'
platform
:
'
ANY
'
,
loggingPrefs
:
{
browser
:
'
SEVERE
'
}
},
};
spec/e2e/gridstack-spec.js
View file @
93bedb44
describe
(
'
gridstack.js
two grids demo
'
,
function
()
{
describe
(
'
gridstack.js
with height
'
,
function
()
{
beforeAll
(
function
()
{
browser
.
ignoreSynchronization
=
true
;
});
beforeEach
(
function
()
{
browser
.
get
(
'
http://localhost:8080/
demo/two
.html
'
);
browser
.
get
(
'
http://localhost:8080/
spec/e2e/html/gridstack-with-height
.html
'
);
});
it
(
'
should have proper title
'
,
function
()
{
expect
(
browser
.
getTitle
()).
toEqual
(
'
Two grids demo
'
);
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
);
});
});
});
spec/e2e/html/gridstack-with-height.html
0 → 100644
View file @
93bedb44
<!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>
<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>
src/gridstack.js
View file @
93bedb44
...
...
@@ -367,6 +367,10 @@
return
$
.
extend
({},
n
);
}));
if
(
typeof
clonedNode
===
'
undefined
'
)
{
return
true
;
}
clone
.
moveNode
(
clonedNode
,
x
,
y
,
width
,
height
);
var
res
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment