From c7915e5bc2d9cd5d8817dbdb11c7b53ff3d19d3d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 20 Oct 2018 03:35:15 -0400 Subject: [PATCH] Don't add four spaces when tabbing to indent list in note Fixes #1236 --- chrome/content/zotero/bindings/noteeditor.xml | 41 +++++-------------- .../zotero/bindings/styled-textbox.xml | 8 ++++ 2 files changed, 18 insertions(+), 31 deletions(-) diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index 51e2e075e8..6b911bd383 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -322,47 +322,26 @@ { + if (!noteField.hasFocus()) { + document.getElementById(id).focus(); + } }, 0); } return; } - // Insert tab manually - // - // From http://kb.mozillazine.org/Inserting_text_at_cursor - try { - var command = "cmd_insertText"; - var controller = document.commandDispatcher.getControllerForCommand(command); - if (controller && controller.isCommandEnabled(command)) { - controller = controller.QueryInterface(Components.interfaces.nsICommandController); - var params = Components.classes["@mozilla.org/embedcomp/command-params;1"] - .createInstance(Components.interfaces.nsICommandParams); - params.setStringValue("state_data", "\t"); - controller.doCommandWithParams(command, params); - } - } - catch (e) { - Zotero.debug("Can't do cmd_insertText!\n" + e, 1); - } - - // DEBUG: is there a better way to prevent blur()? - setTimeout(function() { event.target.focus(); }, 1); break; } ]]> diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index db2924863c..e994d5fe55 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -600,6 +600,14 @@ + + + + + +