combo_auto_box 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,6 +154,28 @@ var ComboAutoBox = {
|
|
154
154
|
}
|
155
155
|
return operators;
|
156
156
|
};
|
157
|
+
|
158
|
+
var i18nShowSearchOptions = function (language) {
|
159
|
+
var title = 'Show search options';
|
160
|
+
switch(language) {
|
161
|
+
case 'pt-br':
|
162
|
+
title = 'Exibir opções de busca';
|
163
|
+
break;
|
164
|
+
case 'pt':
|
165
|
+
title = 'Exibir opções de busca';
|
166
|
+
break;
|
167
|
+
case 'fr':
|
168
|
+
title = 'Afficher les options de recherche';
|
169
|
+
break;
|
170
|
+
case 'es':
|
171
|
+
title = 'Mostrar opciones de búsqueda';
|
172
|
+
break;
|
173
|
+
case 'it':
|
174
|
+
title = 'Visualizza opzioni di ricerca';
|
175
|
+
break;
|
176
|
+
}
|
177
|
+
return title;
|
178
|
+
};
|
157
179
|
|
158
180
|
// generates text field with html options
|
159
181
|
var generateInputTag = function () {
|
@@ -177,7 +199,7 @@ var ComboAutoBox = {
|
|
177
199
|
// On click opens modal image tag inside "i" tag through css
|
178
200
|
var generateExpander = function () {
|
179
201
|
if (options.type == 'simple') {
|
180
|
-
return '<span class="simple"><i></i></span>';
|
202
|
+
return '<span class="simple" title="' + i18nShowSearchOptions(options.lang) + '"><i></i></span>';
|
181
203
|
} else if (options.type == 'multiple') {
|
182
204
|
return '<span class="multiple">' + options.label + ':</span>';
|
183
205
|
}
|
@@ -195,11 +217,47 @@ var ComboAutoBox = {
|
|
195
217
|
} catch (error) {
|
196
218
|
paddingRight = 1;
|
197
219
|
}
|
198
|
-
spanTag.css('margin', '3px 0px 0px ' + (textField
|
199
|
-
|
220
|
+
spanTag.css('margin', '3px 0px 0px ' + (getTextFieldWidth(textField) - 13).toString() + 'px');
|
221
|
+
|
222
|
+
spanTag.children(':first').css('height', (getTextFieldHeight(textField) - 10).toString() + 'px');
|
200
223
|
|
201
224
|
return true;
|
202
225
|
}
|
226
|
+
|
227
|
+
var getTextFieldWidth = function (textField) {
|
228
|
+
var widthTotal = 0;
|
229
|
+
|
230
|
+
if (textField.width() != null) {
|
231
|
+
widthTotal = widthTotal + textField.width();
|
232
|
+
}
|
233
|
+
|
234
|
+
if (textField.css('padding-right') != null) {
|
235
|
+
padding_right = textField.css('padding-right').toString().replace(/[a-zA-Z]+/g, '');
|
236
|
+
widthTotal = widthTotal + parseInt(padding_right);
|
237
|
+
}
|
238
|
+
|
239
|
+
return widthTotal;
|
240
|
+
}
|
241
|
+
|
242
|
+
var getTextFieldHeight = function (textField) {
|
243
|
+
var heightTotal = 0;
|
244
|
+
|
245
|
+
if (textField.height() != null) {
|
246
|
+
heightTotal = heightTotal + textField.height();
|
247
|
+
}
|
248
|
+
|
249
|
+
if (textField.css('padding-top') != null) {
|
250
|
+
padding_top = textField.css('padding-top').toString().replace(/[a-zA-Z]+/g, '');
|
251
|
+
heightTotal = heightTotal + parseInt(padding_top);
|
252
|
+
}
|
253
|
+
|
254
|
+
if (textField.css('padding-bottom') != null) {
|
255
|
+
padding_bottom = textField.css('padding-bottom').toString().replace(/[a-zA-Z]+/g, '');
|
256
|
+
heightTotal = heightTotal + parseInt(padding_bottom);
|
257
|
+
}
|
258
|
+
|
259
|
+
return heightTotal;
|
260
|
+
}
|
203
261
|
|
204
262
|
// Global div for combo auto box
|
205
263
|
var generateDivTag = function () {
|
@@ -210,7 +268,7 @@ var ComboAutoBox = {
|
|
210
268
|
derivation = ' searchable'
|
211
269
|
}
|
212
270
|
|
213
|
-
|
271
|
+
return '<div class="container-combo-auto-box' + derivation + '">' + generateInputTag() + '</div>';
|
214
272
|
};
|
215
273
|
|
216
274
|
// dialog modal
|