Fix appearance of inputs in Firefox for Wikidata schema

This commit is contained in:
Antonin Delpeuch 2018-04-11 19:08:04 +02:00
parent eed1049df3
commit 02f908b827
2 changed files with 12 additions and 8 deletions

View File

@ -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" ||

View File

@ -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;