当我点击一个项目时,我可以通过bootstrap-editable编辑字段。
当我拖放项目时,我可以使用jquery.ui.sortable更改项目的位置。
在Google Chrome中一切正常。
但是,在Firefox
移动项目后,弹出窗口显示编辑字段。
我认为这是由于事件传播引起的。
我试图修复它,但没有成功...
这是我的代码片段:
完整代码可以前往:
https://github.com/antonioJs/CoCoTask/pull/21/files。
工作版本在这里:
http://computerone.altervista.org/CoCoTask/(问题仅出现在Firefox浏览器中)。
如何解决这个问题?
谢谢。
当我拖放项目时,我可以使用jquery.ui.sortable更改项目的位置。
在Google Chrome中一切正常。
但是,在Firefox
15.0.1
中,我遇到了以下问题。移动项目后,弹出窗口显示编辑字段。
我认为这是由于事件传播引起的。
我试图修复它,但没有成功...
这是我的代码片段:
onSortReceive: function (e, ui) {
this.$(ui.item[0]).trigger('drop', this.options.taskType);
// TODO just on firefox there is a issue related to bootstrap-editable
// it shows the popup even if there is e.stopPropagation() here
// the only way to fix this issue is to re-render the view
e.stopPropagation(); // it makes no difference
this.render(); // it fix the problem
// but I want to avoid to re-render the view
},
完整代码可以前往:
https://github.com/antonioJs/CoCoTask/pull/21/files。
工作版本在这里:
http://computerone.altervista.org/CoCoTask/(问题仅出现在Firefox浏览器中)。
如何解决这个问题?
谢谢。
e.preventDefault()
吗? - tkone