Skip to content

Commit

Permalink
fixed #399
Browse files Browse the repository at this point in the history
  • Loading branch information
Atanas Atanasov committed Aug 1, 2018
1 parent 3977182 commit b407573
Show file tree
Hide file tree
Showing 39 changed files with 75 additions and 63 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gijgo",
"version": "1.9.9",
"version": "1.9.10",
"description": "Gijgo is a set of free open source javascript controls distributed under MIT License with built-in support for Bootstrap and Material Design",
"main": [
"./dist/combined/js/gijgo.js",
Expand Down
24 changes: 14 additions & 10 deletions dist/combined/js/gijgo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo JavaScript Library v1.9.9
* Gijgo JavaScript Library v1.9.10
* http://gijgo.com/
*
* Copyright 2014, 2018 gijgo.com
Expand Down Expand Up @@ -516,7 +516,7 @@ gj.core = {
} else {
result = parseInt(style.height, 10);
result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);
result += parseInt(style.borderTop || 0, 10) + parseInt(style.borderBottom || 0, 10);
result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);
}

if (margin) {
Expand All @@ -534,7 +534,7 @@ gj.core = {
} else {
result = parseInt(style.width, 10);
result += parseInt(style.paddingLeft || 0, 10) + parseInt(style.paddingRight || 0, 10);
result += parseInt(style.borderLeft || 0, 10) + parseInt(style.borderRight || 0, 10);
result += parseInt(style.borderLeftWidth || 0, 10) + parseInt(style.borderRightWidth || 0, 10);
}

if (margin) {
Expand Down Expand Up @@ -563,11 +563,11 @@ gj.core = {
if (el.tagName == "BODY") {
xScroll = el.scrollLeft || document.documentElement.scrollLeft;
yScroll = el.scrollTop || document.documentElement.scrollTop;
left += (el.offsetLeft - xScroll + el.clientLeft);
top += (el.offsetTop - yScroll + el.clientTop);
left += el.offsetLeft - xScroll; // + el.clientLeft);
top += el.offsetTop - yScroll; // + el.clientTop);
} else {
left += (el.offsetLeft - el.scrollLeft + el.clientLeft);
top += (el.offsetTop - el.scrollTop + el.clientTop);
left += el.offsetLeft - el.scrollLeft; // + el.clientLeft;
top += el.offsetTop - el.scrollTop; // + el.clientTop;
}

el = el.offsetParent;
Expand Down Expand Up @@ -2131,7 +2131,7 @@ gj.draggable.events = {
* <script>
* $('#element').draggable({
* drag: function (e, newPosition, mousePosition) {
* $('body').append('<div>The drag event is fired. New Element Position = { top:' + offset.top + ', left: ' + offset.left + '}.</div>');
* $('body').append('<div>The drag event is fired. New Element Position = { top:' + newPosition.top + ', left: ' + newPosition.left + '}.</div>');
* }
* });
* </script>
Expand Down Expand Up @@ -12024,7 +12024,7 @@ gj.tree.plugins.dragAndDrop = {
$wrappers = gj.tree.plugins.dragAndDrop.private.getTargetWrappers($tree, $sourceNode),
data = $tree.data();
return function (e, mousePosition) {
var success = false, record, $targetNode, $sourceParentNode;
var success = false, record, $targetNode, $sourceParentNode, parent;
$(this).draggable('destroy').remove();
$displays.each(function () {
var $targetDisplay = $(this), $ul;
Expand All @@ -12042,7 +12042,11 @@ gj.tree.plugins.dragAndDrop = {
//BEGIN: Change node position inside the backend data
record = $tree.getDataById($sourceNode.data('id'));
gj.tree.methods.removeDataById($tree, $sourceNode.data('id'), data.records);
$tree.getDataById($ul.parent().data('id'))[data.childrenField].push(record);
parent = $tree.getDataById($ul.parent().data('id'));
if (parent[data.childrenField] === undefined) {
parent[data.childrenField] = [];
}
parent[data.childrenField].push(record);
//END

gj.tree.plugins.dragAndDrop.private.refresh($tree, $sourceNode, $targetNode, $sourceParentNode);
Expand Down
2 changes: 1 addition & 1 deletion dist/combined/js/gijgo.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modular/js/checkbox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Checkbox v1.9.9
* Gijgo Checkbox v1.9.10
* http://gijgo.com/checkbox
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/colorpicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo ColorPicker v1.9.9
* Gijgo ColorPicker v1.9.10
* http://gijgo.com/colorpicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
14 changes: 7 additions & 7 deletions dist/modular/js/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo JavaScript Library v1.9.9
* Gijgo JavaScript Library v1.9.10
* http://gijgo.com/
*
* Copyright 2014, 2018 gijgo.com
Expand Down Expand Up @@ -431,7 +431,7 @@ gj.documentManager = {
} else {
result = parseInt(style.height, 10);
result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);
result += parseInt(style.borderTop || 0, 10) + parseInt(style.borderBottom || 0, 10);
result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);
}

if (margin) {
Expand All @@ -449,7 +449,7 @@ gj.documentManager = {
} else {
result = parseInt(style.width, 10);
result += parseInt(style.paddingLeft || 0, 10) + parseInt(style.paddingRight || 0, 10);
result += parseInt(style.borderLeft || 0, 10) + parseInt(style.borderRight || 0, 10);
result += parseInt(style.borderLeftWidth || 0, 10) + parseInt(style.borderRightWidth || 0, 10);
}

if (margin) {
Expand Down Expand Up @@ -478,11 +478,11 @@ gj.documentManager = {
if (el.tagName == "BODY") {
xScroll = el.scrollLeft || document.documentElement.scrollLeft;
yScroll = el.scrollTop || document.documentElement.scrollTop;
left += (el.offsetLeft - xScroll + el.clientLeft);
top += (el.offsetTop - yScroll + el.clientTop);
left += el.offsetLeft - xScroll; // + el.clientLeft);
top += el.offsetTop - yScroll; // + el.clientTop);
} else {
left += (el.offsetLeft - el.scrollLeft + el.clientLeft);
top += (el.offsetTop - el.scrollTop + el.clientTop);
left += el.offsetLeft - el.scrollLeft; // + el.clientLeft;
top += el.offsetTop - el.scrollTop; // + el.clientTop;
}

el = el.offsetParent;
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modular/js/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo DatePicker v1.9.9
* Gijgo DatePicker v1.9.10
* http://gijgo.com/datepicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/datetimepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo DateTimePicker v1.9.9
* Gijgo DateTimePicker v1.9.10
* http://gijgo.com/datetimepicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/dialog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Dialog v1.9.9
* Gijgo Dialog v1.9.10
* http://gijgo.com/dialog
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/draggable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Draggable v1.9.9
* Gijgo Draggable v1.9.10
* http://gijgo.com/draggable
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo DropDown v1.9.9
* Gijgo DropDown v1.9.10
* http://gijgo.com/dropdown
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/droppable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Droppable v1.9.9
* Gijgo Droppable v1.9.10
* http://gijgo.com/droppable
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/editor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Editor v1.9.9
* Gijgo Editor v1.9.10
* http://gijgo.com/editor
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/grid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Grid v1.9.9
* Gijgo Grid v1.9.10
* http://gijgo.com/grid
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/slider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Slider v1.9.9
* Gijgo Slider v1.9.10
* http://gijgo.com/slider
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/timepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo TimePicker v1.9.9
* Gijgo TimePicker v1.9.10
* http://gijgo.com/timepicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
10 changes: 7 additions & 3 deletions dist/modular/js/tree.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Tree v1.9.9
* Gijgo Tree v1.9.10
* http://gijgo.com/tree
*
* Copyright 2014, 2018 gijgo.com
Expand Down Expand Up @@ -1187,7 +1187,7 @@ gj.tree.widget.constructor = gj.tree.widget;
$wrappers = gj.tree.plugins.dragAndDrop.private.getTargetWrappers($tree, $sourceNode),
data = $tree.data();
return function (e, mousePosition) {
var success = false, record, $targetNode, $sourceParentNode;
var success = false, record, $targetNode, $sourceParentNode, parent;
$(this).draggable('destroy').remove();
$displays.each(function () {
var $targetDisplay = $(this), $ul;
Expand All @@ -1205,7 +1205,11 @@ gj.tree.widget.constructor = gj.tree.widget;
//BEGIN: Change node position inside the backend data
record = $tree.getDataById($sourceNode.data('id'));
gj.tree.methods.removeDataById($tree, $sourceNode.data('id'), data.records);
$tree.getDataById($ul.parent().data('id'))[data.childrenField].push(record);
parent = $tree.getDataById($ul.parent().data('id'));
if (parent[data.childrenField] === undefined) {
parent[data.childrenField] = [];
}
parent[data.childrenField].push(record);
//END

gj.tree.plugins.dragAndDrop.private.refresh($tree, $sourceNode, $targetNode, $sourceParentNode);
Expand Down
2 changes: 1 addition & 1 deletion dist/modular/js/tree.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/draggable/Draggable.Base.drag.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script>
$('#element').draggable({
drag: function (e, newPosition, mousePosition) {
$('body').append('<div>The drag event is fired. New Element Position = { top:' + offset.top + ', left: ' + offset.left + '}.</div>');
$('body').append('<div>The drag event is fired. New Element Position = { top:' + newPosition.top + ', left: ' + newPosition.left + '}.</div>');
}
});
</script>
Expand Down
4 changes: 2 additions & 2 deletions examples/tests/tempslider.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<title>Bootstrap Slider</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/gijgo@1.9.9/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/npm/gijgo@1.9.9/css/gijgo.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/gijgo@1.9.10/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/npm/gijgo@1.9.10/css/gijgo.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<input id="slider" width="300" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gijgo",
"version": "1.9.9",
"version": "1.9.10",
"description": "Gijgo is a set of free open source javascript controls distributed under MIT License. All widgets are high performance, built on top of the jQuery JavaScript Library and with built-in support for Bootstrap and jQuery UI. They are designed to saves you time and scales with your development process.",
"main": "js/gijgo.js",
"homepage": "http://gijgo.com/",
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Checkbox v1.9.9
* Gijgo Checkbox v1.9.10
* http://gijgo.com/checkbox
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/colorpicker/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo ColorPicker v1.9.9
* Gijgo ColorPicker v1.9.10
* http://gijgo.com/colorpicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
12 changes: 6 additions & 6 deletions src/core/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ gj.core = {
} else {
result = parseInt(style.height, 10);
result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);
result += parseInt(style.borderTop || 0, 10) + parseInt(style.borderBottom || 0, 10);
result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);
}

if (margin) {
Expand All @@ -527,7 +527,7 @@ gj.core = {
} else {
result = parseInt(style.width, 10);
result += parseInt(style.paddingLeft || 0, 10) + parseInt(style.paddingRight || 0, 10);
result += parseInt(style.borderLeft || 0, 10) + parseInt(style.borderRight || 0, 10);
result += parseInt(style.borderLeftWidth || 0, 10) + parseInt(style.borderRightWidth || 0, 10);
}

if (margin) {
Expand Down Expand Up @@ -556,11 +556,11 @@ gj.core = {
if (el.tagName == "BODY") {
xScroll = el.scrollLeft || document.documentElement.scrollLeft;
yScroll = el.scrollTop || document.documentElement.scrollTop;
left += (el.offsetLeft - xScroll + el.clientLeft);
top += (el.offsetTop - yScroll + el.clientTop);
left += el.offsetLeft - xScroll; // + el.clientLeft);
top += el.offsetTop - yScroll; // + el.clientTop);
} else {
left += (el.offsetLeft - el.scrollLeft + el.clientLeft);
top += (el.offsetTop - el.scrollTop + el.clientTop);
left += el.offsetLeft - el.scrollLeft; // + el.clientLeft;
top += el.offsetTop - el.scrollTop; // + el.clientTop;
}

el = el.offsetParent;
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo DatePicker v1.9.9
* Gijgo DatePicker v1.9.10
* http://gijgo.com/datepicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/datetimepicker/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo DateTimePicker v1.9.9
* Gijgo DateTimePicker v1.9.10
* http://gijgo.com/datetimepicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Dialog v1.9.9
* Gijgo Dialog v1.9.10
* http://gijgo.com/dialog
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/draggable/js/draggable.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ gj.draggable.events = {
* <script>
* $('#element').draggable({
* drag: function (e, newPosition, mousePosition) {
* $('body').append('<div>The drag event is fired. New Element Position = { top:' + offset.top + ', left: ' + offset.left + '}.</div>');
* $('body').append('<div>The drag event is fired. New Element Position = { top:' + newPosition.top + ', left: ' + newPosition.left + '}.</div>');
* }
* });
* </script>
Expand Down
2 changes: 1 addition & 1 deletion src/draggable/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Draggable v1.9.9
* Gijgo Draggable v1.9.10
* http://gijgo.com/draggable
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo DropDown v1.9.9
* Gijgo DropDown v1.9.10
* http://gijgo.com/dropdown
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/droppable/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Droppable v1.9.9
* Gijgo Droppable v1.9.10
* http://gijgo.com/droppable
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/editor/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Editor v1.9.9
* Gijgo Editor v1.9.10
* http://gijgo.com/editor
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/grid/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Grid v1.9.9
* Gijgo Grid v1.9.10
* http://gijgo.com/grid
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo JavaScript Library v1.9.9
* Gijgo JavaScript Library v1.9.10
* http://gijgo.com/
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/slider/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo Slider v1.9.9
* Gijgo Slider v1.9.10
* http://gijgo.com/slider
*
* Copyright 2014, 2018 gijgo.com
Expand Down
2 changes: 1 addition & 1 deletion src/timepicker/js/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Gijgo TimePicker v1.9.9
* Gijgo TimePicker v1.9.10
* http://gijgo.com/timepicker
*
* Copyright 2014, 2018 gijgo.com
Expand Down
Loading

0 comments on commit b407573

Please sign in to comment.