Bug 1113681 - Prevent dragging search engines from the checkboxes. r=Florian

This commit is contained in:
Abdelrhman Ahmed 2015-02-03 13:56:09 +01:00
parent 12679ea765
commit 7a7ddc2485
2 changed files with 16 additions and 2 deletions

View File

@ -239,7 +239,10 @@ var gSearchPane = {
function onDragEngineStart(event) {
var selectedIndex = gEngineView.selectedIndex;
if (selectedIndex >= 0) {
var tree = document.getElementById("engineList");
var row = { }, col = { }, child = { };
tree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, child);
if (selectedIndex >= 0 && !gEngineView.isCheckBox(row.value, col.value)) {
event.dataTransfer.setData(ENGINE_FLAVOR, selectedIndex.toString());
event.dataTransfer.effectAllowed = "move";
}
@ -408,6 +411,10 @@ EngineView.prototype = {
return parseInt(dataTransfer.getData(ENGINE_FLAVOR));
},
isCheckBox: function(index, column) {
return column.id == "engineShown";
},
// nsITreeView
get rowCount() {
return this._engineStore.engines.length;

View File

@ -190,7 +190,10 @@ var gSearchPane = {
function onDragEngineStart(event) {
var selectedIndex = gEngineView.selectedIndex;
if (selectedIndex >= 0) {
var tree = document.getElementById("engineList");
var row = { }, col = { }, child = { };
tree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, child);
if (selectedIndex >= 0 && !gEngineView.isCheckBox(row.value, col.value)) {
event.dataTransfer.setData(ENGINE_FLAVOR, selectedIndex.toString());
event.dataTransfer.effectAllowed = "move";
}
@ -435,6 +438,10 @@ EngineView.prototype = {
return parseInt(dataTransfer.getData(ENGINE_FLAVOR));
},
isCheckBox: function(index, column) {
return column.id == "engineShown";
},
// nsITreeView
get rowCount() {
return this._engineStore.engines.length;