redmine_extensions 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c54c79b99314f16b3c9b00441a76daa37163ccc
|
4
|
+
data.tar.gz: 94549012ed16ef815d480e77effe0ba27d55223c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f560f0cef90aaf337d32aaaf9ebe4413ce3fe9b1256e46c086c7f75453c477f5a58ef41bda3de09eb975cc241b52c30207fb41cbc9c97dfe0c2d76d213d1e6a
|
7
|
+
data.tar.gz: 13da939d8836988e2a2893f2c33fd8617d43caf78463e68c625079f2c43815406fff3d05f01207bc9cdc2becbf8915efddf95dbd80bef63469ddec218faa21b9
|
@@ -383,13 +383,14 @@ window.closeFlashMessage = (function($element){
|
|
383
383
|
var $elem = $(this);
|
384
384
|
evt.preventDefault();
|
385
385
|
that.load(function(){
|
386
|
-
select = $('<select>').prop('multiple', true).prop('size', 5).prop('name', that.inputName);
|
386
|
+
var select = $('<select>').prop('multiple', true).prop('size', 5).prop('name', that.inputName);
|
387
|
+
var option;
|
387
388
|
$.each(that.possibleValues, function(i, v) {
|
388
389
|
option = $('<option>').prop('value', v.id).text(v.value);
|
389
390
|
option.prop('selected', that.getValue().indexOf(v.id) > -1);
|
390
391
|
select.append(option);
|
391
392
|
});
|
392
|
-
$container = $elem.closest('.easy-multiselect-tag-container');
|
393
|
+
var $container = $elem.closest('.easy-multiselect-tag-container');
|
393
394
|
$container.find(':input').prop('disabled', true);
|
394
395
|
$container.children().hide();
|
395
396
|
$container.append(select);
|
@@ -416,7 +417,7 @@ window.closeFlashMessage = (function($element){
|
|
416
417
|
response();
|
417
418
|
});
|
418
419
|
} else { // asking server everytime
|
419
|
-
if( typeof that.options.source
|
420
|
+
if( typeof that.options.source === 'function' ) {
|
420
421
|
that.options.source(function(json){
|
421
422
|
response(that.options.rootElement ? json[that.options.rootElement] : json);
|
422
423
|
});
|
@@ -431,7 +432,7 @@ window.closeFlashMessage = (function($element){
|
|
431
432
|
},
|
432
433
|
minLength: 0,
|
433
434
|
select: function(event, ui) {
|
434
|
-
that.selectValue(ui.item)
|
435
|
+
that.selectValue(ui.item);
|
435
436
|
return false;
|
436
437
|
},
|
437
438
|
change: function(event, ui) {
|
@@ -515,8 +516,8 @@ window.closeFlashMessage = (function($element){
|
|
515
516
|
this.valuesLoaded = true;
|
516
517
|
|
517
518
|
this.selectedValues = this.selectedValues ? this.selectedValues : [];
|
518
|
-
if( this.selectedValues.length
|
519
|
-
this.selectedValues.push(this.possibleValues[0]['id'])
|
519
|
+
if( this.selectedValues.length === 0 && this.options.preload && this.options.select_first_value && this.possibleValues.length > 0 ) {
|
520
|
+
this.selectedValues.push(this.possibleValues[0]['id']);
|
520
521
|
}
|
521
522
|
|
522
523
|
this.setValue(this.selectedValues);
|
@@ -538,7 +539,7 @@ window.closeFlashMessage = (function($element){
|
|
538
539
|
|
539
540
|
this.loading = true;
|
540
541
|
function successFce(json, status, xhr) {
|
541
|
-
var data = that.options.rootElement ? json[that.options.rootElement] : json
|
542
|
+
var data = that.options.rootElement ? json[that.options.rootElement] : json;
|
542
543
|
if( !data && window.console ) {
|
543
544
|
console.warn('Data could not be loaded! Please check the datasource.');
|
544
545
|
data = [];
|
@@ -584,10 +585,12 @@ window.closeFlashMessage = (function($element){
|
|
584
585
|
return false;
|
585
586
|
|
586
587
|
if( this.options.preload ) {
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
588
|
+
this.load(function(){
|
589
|
+
if( that.options.multiple ) {
|
590
|
+
that.valueElement.entityArray('clear');
|
591
|
+
}
|
592
|
+
that._setValues(values);
|
593
|
+
});
|
591
594
|
} else {
|
592
595
|
if( that.options.multiple ) {
|
593
596
|
that.valueElement.entityArray('clear');
|
@@ -599,17 +602,15 @@ window.closeFlashMessage = (function($element){
|
|
599
602
|
_setValues: function(values) {
|
600
603
|
var selected = [];
|
601
604
|
|
602
|
-
if( values.length
|
605
|
+
if( values.length === 0 )
|
603
606
|
return false;
|
604
607
|
|
605
608
|
// allows the combination of only id values and values with label
|
606
609
|
for (var i = values.length - 1; i >= 0; i--) {
|
607
|
-
var identifier, label;
|
608
610
|
if( values[i] instanceof Object && !Array.isArray(values[i]) && values[i] !== null ) {
|
609
611
|
selected.push( values[i] );
|
610
612
|
} else if( this.options.preload ) {
|
611
613
|
var that = this;
|
612
|
-
this.load(function(){
|
613
614
|
if( !Array.isArray(that.possibleValues) )
|
614
615
|
return;
|
615
616
|
for(var j = that.possibleValues.length - 1; j >= 0; j-- ) {
|
@@ -618,7 +619,6 @@ window.closeFlashMessage = (function($element){
|
|
618
619
|
break;
|
619
620
|
}
|
620
621
|
}
|
621
|
-
});
|
622
622
|
} else {
|
623
623
|
selected.push( {id: values[i], value: values[i]} );
|
624
624
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Easy Software Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|