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;1m> Checking out gh-pages\033[0m"
branch -D gh-pages
echo -e "\033[0;33;1m> Checking out gh-pages...\033[0m"
git branch -D gh-pages -q
git checkout -q -b gh-pages
echo -e "\033[0;33;1m> Delete server branch\033[0m"
git push origin :gh-pages
echo -e "\033[0;33;1m> Delete server branch...\033[0m"
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
rm -f GRUNT_OUTPUT
echo -e "\033[0;33;1m> Commit dist js files...\033[0m"
git add dist
echo -e "\033[0;33;1m> Commit dist js files\033[0m"
git commit -qm "publish"
echo -e "\033[0;33;1m> Pusing to git...\033[0m"
......
......@@ -123,8 +123,8 @@ kity.extendClass(Minder, (function() {
}
for (j = 0; j < nodes.length; j++) {
this.fire('afterrender', {
node: node
this.fire('noderender', {
node: nodes[j]
});
}
},
......
......@@ -28,6 +28,20 @@ var ViewDragger = kity.createClass("ViewDragger", {
lastPosition = 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) {
if (e.originEvent.button == 2) {
......@@ -68,16 +82,9 @@ var ViewDragger = kity.createClass("ViewDragger", {
}
})
.on('mouseup touchend', function(e) {
lastPosition = null;
.on('mouseup touchend', dragEnd);
// 临时拖动需要还原状态
if (isTempDrag) {
dragger.setEnabled(false);
isTempDrag = false;
this.rollbackStatus();
}
});
window.addEventListener('mouseup', dragEnd);
}
});
......
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