redmine_extensions 0.1.23 → 0.1.24

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: 99c597f9913c0ffc04ec325076ab8ad35091cd3c
4
- data.tar.gz: 452764ffbb2580c21cf3fa2b53825f251fd75d64
3
+ metadata.gz: 971f3ed64d0eff02c0ce05f829e5c9a2761a9a1c
4
+ data.tar.gz: 367744a4344284fd502ee1c5aaac46d5308ad534
5
5
  SHA512:
6
- metadata.gz: 208649b38c1944d902bd2385734c1cfbf06270b16827d615ea4832ffaefa552d6c7e05c0e0db396fb3fc6d016be873961fd407a2c62ad8e35021beb14a72f567
7
- data.tar.gz: 6ae91032ab6d6edbd54c351cccc6e2db3f0fda795beb63dc58741c0f45a4d4ab01779d2d2de6a5d54726efd005f26deb123b92fa8bbbe2f50dcdcb0480b584b6
6
+ metadata.gz: 7b5ec3025f3cb6ea81691aedb52b47104846ffaa9c36c6f41d995b0eb358ac95660780851db208d0a158be3b70e6f4a80c52c0c6010febd157eff939f6123f75
7
+ data.tar.gz: 65ccfbdc8c07b8e82784fe493f5cd4c3bdc0f2ee6c3159d2fac61e9ea64c569d8d9fb44b0af9879dd9cfe992bea905e403f5f136b1bdced7e5a38ca43275070e
@@ -584,12 +584,10 @@ window.closeFlashMessage = (function($element){
584
584
  return false;
585
585
 
586
586
  if( this.options.preload ) {
587
- this.load(function(){
588
- if( that.options.multiple ) {
589
- that.valueElement.entityArray('clear');
590
- }
591
- that._setValues(values);
592
- });
587
+ if( that.options.multiple ) {
588
+ that.valueElement.entityArray('clear');
589
+ }
590
+ that._setValues(values);
593
591
  } else {
594
592
  if( that.options.multiple ) {
595
593
  that.valueElement.entityArray('clear');
@@ -609,13 +607,18 @@ window.closeFlashMessage = (function($element){
609
607
  var identifier, label;
610
608
  if( values[i] instanceof Object && !Array.isArray(values[i]) && values[i] !== null ) {
611
609
  selected.push( values[i] );
612
- } else if( this.options.preload && Array.isArray(this.possibleValues) ) {
613
- for(var j = this.possibleValues.length - 1; j >= 0; j-- ) {
614
- if ( values[i] == this.possibleValues[j].id || values[i] == this.possibleValues[j].id.toString() ) {
615
- selected.push(this.possibleValues[j]);
616
- break;
610
+ } else if( this.options.preload ) {
611
+ var that = this;
612
+ this.load(function(){
613
+ if( !Array.isArray(that.possibleValues) )
614
+ return;
615
+ for(var j = that.possibleValues.length - 1; j >= 0; j-- ) {
616
+ if ( values[i] === that.possibleValues[j].id || values[i] === that.possibleValues[j].id.toString() ) {
617
+ selected.push(that.possibleValues[j]);
618
+ break;
619
+ }
617
620
  }
618
- }
621
+ });
619
622
  } else {
620
623
  selected.push( {id: values[i], value: values[i]} );
621
624
  }
@@ -31,9 +31,13 @@ module RedmineExtensions
31
31
  end
32
32
 
33
33
  def enabled_outputs
34
- res = available_output_names.map(&:to_s) if available_output_names.count == 1
35
- res ||= @query.outputs
36
- res << 'list' if res.empty? && available_outputs.empty?
34
+ available = available_output_names.map(&:to_s)
35
+ res = if available.one?
36
+ available
37
+ else
38
+ Array(@query.outputs).map(&:to_s) & available
39
+ end
40
+ res << 'list' if res.empty?
37
41
  res
38
42
  end
39
43
 
@@ -345,7 +345,7 @@ module RedmineExtensions
345
345
  end
346
346
 
347
347
  def apply_patch
348
- if (cond = @options.delete(:if)) && cond.respond_to?(:call)
348
+ if (cond = @options[:if]) && cond.respond_to?(:call)
349
349
  return unless cond.call
350
350
  end
351
351
 
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.1.23'
2
+ VERSION = '0.1.24'
3
3
  end
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.23
4
+ version: 0.1.24
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-04-25 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails