Skip to content

Commit

Permalink
removed unnecessary logging of drag events
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRaven2000 committed Nov 10, 2022
1 parent 9f8d5fe commit 7ada31d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
6 changes: 2 additions & 4 deletions chrome/content/quickfolders-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1454,10 +1454,8 @@ allowUndo = true)`
anchor = URL.substr(x);
URL = URL.substr(0, x)
}
if (URL.indexOf("?")==-1)
URL = URL + "?user=" + uType + anchor;
else
URL = URL + "&user=" + uType + anchor;
if (URL.indexOf("?")==-1) { URL = URL + "?user=" + uType + anchor; }
else { URL = URL + "&user=" + uType + anchor; }
}
}
catch(ex) {
Expand Down
28 changes: 7 additions & 21 deletions chrome/content/quickfolders.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,6 @@ var QuickFolders = {
compactLastFolderSize: 0,
compactLastFolderUri: null,
selectedOptionsTab : -1,// preselect a tab -1 = default; remember last viewed tab!

//for testing
debug_log: function debug_log(ev) {
const prefs = QuickFolders.Preferences;
if (prefs.isDebug)
console.log("DnD " + ev);
},

// helper function to do init from options dialog!
initDocAndWindow: function initDocAndWindow(win) {
Expand Down Expand Up @@ -820,18 +813,12 @@ var QuickFolders = {
QuickFolders.Util.alert("Hello from QuickFolders");
} ,

// handler for dropping folder shortcuts
// handler for dropping folder shortcuts (and emails!)
toolbarDragObserver: {
get util() { return QuickFolders.Util; } ,
get prefs() { return QuickFolders.Preferences; } ,
win: QuickFolders_getWindow(),
doc: QuickFolders_getDocument(),
debug_log: function debug_log(ev) {
let type = ev.type || "",
id = ev.target ? (ev.target.id || "") : "no target",
txt = ev ? (type + " " + id) : "";
console.log("toolbarDragObserver:DnD " + txt, ev) ;
},

canHandleMultipleItems: false,

Expand All @@ -846,8 +833,6 @@ var QuickFolders = {


dragExit: function dragExit(evt) {
if (!evt)
debugger;
this.util.logDebugOptional("dnd","toolbarDragObserver.dragExit");
if (QuickFolders_globalHidePopupId) {
QuickFolders.Interface.removeLastPopup(QuickFolders_globalHidePopupId, this.doc);
Expand Down Expand Up @@ -883,7 +868,7 @@ var QuickFolders = {
debugger;
evt.preventDefault();

let dragSession = Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).getCurrentSession();
let dragSession = Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).getCurrentSession();

let types = Array.from(evt.dataTransfer.mozTypesAt(0)),
contentType = types[0];
Expand Down Expand Up @@ -1105,8 +1090,9 @@ var QuickFolders = {
} ,

dragOver: function menuObs_dragOver(evt, flavour, dragSession){
if (!dragSession)
if (!dragSession) {
dragSession = Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).getCurrentSession();
}

let types = Array.from(evt.dataTransfer.mozTypesAt(0)),
contentType = types[0];
Expand Down Expand Up @@ -1337,9 +1323,9 @@ var QuickFolders = {
dragOverTimer: null,

dragEnter: function btnObs_dragEnter(evt, dragSession) {
if (!evt) debugger;

if (!dragSession) dragSession = Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).getCurrentSession();
if (!dragSession) {
dragSession = Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).getCurrentSession();
}

const util = QuickFolders.Util,
prefs = QuickFolders.Preferences,
Expand Down
1 change: 0 additions & 1 deletion chrome/content/scripts/qf-messenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ async function onLoad(activatedWhileWindowOpen) {
class="toolbar-primary contentTabToolbar"
ondragover="(QuickFolders.toolbarDragObserver).dragOver(event);"
ondrop="(QuickFolders.toolbarDragObserver).drop(event);"
ondragenter="QuickFolders.toolbarDragObserver.debug_log(event);"
dragdroparea="QuickFolders-FoldersBox"
customizable="false"
context="QuickFolders-ToolbarPopup"
Expand Down

0 comments on commit 7ada31d

Please sign in to comment.