Commit 3cb34903 authored by techird's avatar techird

fix drag outside issue

parent 86007449
echo -e "\033[0;33;1mPublish start." echo -e "\033[0;33;1mPublish start."
echo -e "\033[0;33;1m> Checking out gh-pages\033[0m" echo -e "\033[0;33;1m> Checking out gh-pages...\033[0m"
branch -D gh-pages git branch -D gh-pages -q
git checkout -q -b gh-pages git checkout -q -b gh-pages
echo -e "\033[0;33;1m> Delete server branch\033[0m" echo -e "\033[0;33;1m> Delete server branch...\033[0m"
git push origin :gh-pages git push origin :gh-pages -q
echo -e "\033[0;33;1m> Building dist js files\033[0m" echo -e "\033[0;33;1m> Building dist js files...\033[0m"
grunt -q > GRUNT_OUTPUT grunt -q > GRUNT_OUTPUT
rm -f GRUNT_OUTPUT rm -f GRUNT_OUTPUT
echo -e "\033[0;33;1m> Commit dist js files...\033[0m"
git add dist git add dist
echo -e "\033[0;33;1m> Commit dist js files\033[0m"
git commit -qm "publish" git commit -qm "publish"
echo -e "\033[0;33;1m> Pusing to git...\033[0m" echo -e "\033[0;33;1m> Pusing to git...\033[0m"
......
...@@ -123,8 +123,8 @@ kity.extendClass(Minder, (function() { ...@@ -123,8 +123,8 @@ kity.extendClass(Minder, (function() {
} }
for (j = 0; j < nodes.length; j++) { for (j = 0; j < nodes.length; j++) {
this.fire('afterrender', { this.fire('noderender', {
node: node node: nodes[j]
}); });
} }
}, },
......
...@@ -28,6 +28,20 @@ var ViewDragger = kity.createClass("ViewDragger", { ...@@ -28,6 +28,20 @@ var ViewDragger = kity.createClass("ViewDragger", {
lastPosition = null, lastPosition = null,
currentPosition = null; currentPosition = null;
function dragEnd(e) {
lastPosition = null;
e.stopPropagation();
// 临时拖动需要还原状态
if (isTempDrag) {
dragger.setEnabled(false);
isTempDrag = false;
if (dragger._minder.getStatus() == 'hand')
dragger._minder.rollbackStatus();
}
}
this._minder.on('normal.mousedown normal.touchstart readonly.mousedown readonly.touchstart', function(e) { this._minder.on('normal.mousedown normal.touchstart readonly.mousedown readonly.touchstart', function(e) {
if (e.originEvent.button == 2) { if (e.originEvent.button == 2) {
...@@ -68,16 +82,9 @@ var ViewDragger = kity.createClass("ViewDragger", { ...@@ -68,16 +82,9 @@ var ViewDragger = kity.createClass("ViewDragger", {
} }
}) })
.on('mouseup touchend', function(e) { .on('mouseup touchend', dragEnd);
lastPosition = null;
// 临时拖动需要还原状态 window.addEventListener('mouseup', dragEnd);
if (isTempDrag) {
dragger.setEnabled(false);
isTempDrag = false;
this.rollbackStatus();
}
});
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment