当我单击一个项目时,我可以编辑该字段,这要归功于引导程序可编辑 http://vitalets.github.com/bootstrap-editable/.
当我拖放项目时,我可以更改项目的位置,这要归功于jquery.ui.sortable http://jqueryui.com/demos/sortable/#connect-lists.
使用谷歌浏览器一切正常。
使用火狐浏览器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 https://github.com/antonioJs/CoCoTask/pull/21/files
对于工作版本,您可以继续:
http://computerone.altervista.org/CoCoTask/ http://computerone.altervista.org/CoCoTask/(问题出在 Firefox 上)
知道如何解决这个问题吗?
Thanks
好的,这是我发现的一种工作方式。在你的taskItem.js
代替onRender
与以下代码:
onRender: function () {
var sortInAction = false;
this.$el.find('label').mouseup(function(e) {
sortInAction = 'absolute' === $(e.target).closest('li').css('position');
}).click(function(e) {
if (sortInAction)
e.stopImmediatePropagation();
}).editable({
type: 'textarea',
name: 'task-name',
validate: this.editTaskName,
template: '<textarea rows="3"></textarea>'
});
},
希望能帮助到你。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)