Skip to content

Commit

Permalink
[UPD] Label prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Feb 7, 2024
1 parent e21a26a commit 1fc7e07
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
20 changes: 12 additions & 8 deletions dist/ol-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -15697,22 +15697,26 @@ ol.control.SearchGeoportailParcelle = class olcontrolSearchGeoportailParcelle ex
var div = ol.ext.element.create('DIV', {
parent: element
});
options.arrondLabel = options.arrondLabel || 'Arrond.'
options.prefixLabel = options.prefixLabel || 'Préfixe'
options.sectionLabel = options.sectionLabel || 'Section'
options.numberLabel = options.numberLabel || 'Numéro'
// Labels
ol.ext.element.create('LABEL', {
text: 'Arrond.',
text: options.arrondLabel,
className: 'district',
parent: div
});
ol.ext.element.create('LABEL', {
text: 'Préfixe',
text: options.prefixLabel,
parent: div
});
ol.ext.element.create('LABEL', {
text: 'Section',
text: options.sectionLabel,
parent: div
});
ol.ext.element.create('LABEL', {
text: 'Numéro',
text: options.numberLabel,
parent: div
});
ol.ext.element.create('BR', {
Expand All @@ -15726,13 +15730,13 @@ ol.control.SearchGeoportailParcelle = class olcontrolSearchGeoportailParcelle ex
numero: document.createElement('INPUT')
};
this._inputParcelle.arrond.setAttribute('maxlength', 2);
this._inputParcelle.arrond.setAttribute('placeholder', options.arrondLabel || 'Arrond');
this._inputParcelle.arrond.setAttribute('placeholder', options.arrondLabel);
this._inputParcelle.prefix.setAttribute('maxlength', 3);
this._inputParcelle.prefix.setAttribute('placeholder', options.prefixLabel || 'Préfixe');
this._inputParcelle.prefix.setAttribute('placeholder', options.prefixLabel);
this._inputParcelle.section.setAttribute('maxlength', 2);
this._inputParcelle.section.setAttribute('placeholder', options.sectionLabel || 'Section');
this._inputParcelle.section.setAttribute('placeholder', options.sectionLabel);
this._inputParcelle.numero.setAttribute('maxlength', 4);
this._inputParcelle.numero.setAttribute('placeholder', options.numberLabel || 'Numéro');
this._inputParcelle.numero.setAttribute('placeholder', options.numberLabel);
// Delay search
var tout;
var doSearch = function () {
Expand Down
2 changes: 1 addition & 1 deletion dist/ol-ext.min.js

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions src/control/SearchGeoportailParcelle.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,26 @@ var ol_control_SearchGeoportailParcelle = class olcontrolSearchGeoportailParcell
parent: element
});

options.arrondLabel = options.arrondLabel || 'Arrond.'
options.prefixLabel = options.prefixLabel || 'Préfixe'
options.sectionLabel = options.sectionLabel || 'Section'
options.numberLabel = options.numberLabel || 'Numéro'
// Labels
ol_ext_element.create('LABEL', {
text: 'Arrond.',
text: options.arrondLabel,
className: 'district',
parent: div
});
ol_ext_element.create('LABEL', {
text: 'Préfixe',
text: options.prefixLabel,
parent: div
});
ol_ext_element.create('LABEL', {
text: 'Section',
text: options.sectionLabel,
parent: div
});
ol_ext_element.create('LABEL', {
text: 'Numéro',
text: options.numberLabel,
parent: div
});
ol_ext_element.create('BR', {
Expand All @@ -80,13 +84,13 @@ var ol_control_SearchGeoportailParcelle = class olcontrolSearchGeoportailParcell
};

this._inputParcelle.arrond.setAttribute('maxlength', 2);
this._inputParcelle.arrond.setAttribute('placeholder', options.arrondLabel || 'Arrond');
this._inputParcelle.arrond.setAttribute('placeholder', options.arrondLabel);
this._inputParcelle.prefix.setAttribute('maxlength', 3);
this._inputParcelle.prefix.setAttribute('placeholder', options.prefixLabel || 'Préfixe');
this._inputParcelle.prefix.setAttribute('placeholder', options.prefixLabel);
this._inputParcelle.section.setAttribute('maxlength', 2);
this._inputParcelle.section.setAttribute('placeholder', options.sectionLabel || 'Section');
this._inputParcelle.section.setAttribute('placeholder', options.sectionLabel);
this._inputParcelle.numero.setAttribute('maxlength', 4);
this._inputParcelle.numero.setAttribute('placeholder', options.numberLabel || 'Numéro');
this._inputParcelle.numero.setAttribute('placeholder', options.numberLabel);

// Delay search
var tout;
Expand Down

0 comments on commit 1fc7e07

Please sign in to comment.