From 02f908b8275f5d9717b45fc06dab1eade9347916 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Wed, 11 Apr 2018 19:08:04 +0200 Subject: [PATCH] Fix appearance of inputs in Firefox for Wikidata schema --- .../scripts/dialogs/schema-alignment-dialog.js | 12 +++++++----- .../styles/dialogs/schema-alignment-dialog.less | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js index 7ddaec313..e3e380b72 100644 --- a/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js +++ b/extensions/wikidata/module/scripts/dialogs/schema-alignment-dialog.js @@ -176,13 +176,14 @@ SchemaAlignmentDialog.launch = function(onDone) { this._reset(theProject.overlayModels.wikibaseSchema, true); } - -$(window).bind('beforeunload', function(e) { - if (SchemaAlignmentDialog.isSetUp() && SchemaAlignmentDialog._hasUnsavedChanges) { +var beforeUnload = function(e) { + console.log(SchemaAlignmentDialog._hasUnsavedChanges); + if (SchemaAlignmentDialog.isSetUp() && SchemaAlignmentDialog._hasUnsavedChanges === true) { return (e = $.i18n._('wikidata-schema')["unsaved-warning"]); } - return null; -}); +}; + +$(window).bind('beforeunload', beforeUnload); SchemaAlignmentDialog._reset = function(schema, initial) { this._originalSchema = schema || { itemDocuments: [] }; @@ -1015,6 +1016,7 @@ SchemaAlignmentDialog._initField = function(inputContainer, mode, initialValue, input.val(initialValue.value); } else if (initialValue.type === "wblanguageconstant") { input.val(initialValue.id); + input.addClass("wbs-validated-input"); } else if (initialValue.type === "wbstringvariable" || initialValue.type === "wbdatevariable" || initialValue.type === "wblocationvariable" || diff --git a/extensions/wikidata/module/styles/dialogs/schema-alignment-dialog.less b/extensions/wikidata/module/styles/dialogs/schema-alignment-dialog.less index d6a21eb0e..81b3ecd09 100644 --- a/extensions/wikidata/module/styles/dialogs/schema-alignment-dialog.less +++ b/extensions/wikidata/module/styles/dialogs/schema-alignment-dialog.less @@ -171,10 +171,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .wbs-item-input, .wbs-prop-input, .wbs-target-input { width: 250px; height: 20px; - /* border: 1px solid #a2a9b1; */ display: inline-block; - /* background: white; */ margin: 5px; + white-space: normal; + word-wrap: break-word; } .wbs-target-input { @@ -193,7 +193,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. width: 120px; } -.wbs-item-input input, .wbs-prop-input input, .wbs-target-input input { +// Fix input rendering for Firefox +.wbs-item-input input, .wbs-prop-input input, .wbs-target-input input, +.wbs-monolingual-container input { width: 100%; border: solid #b5b5b5 1px; padding: 2px;