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: 971f3ed64d0eff02c0ce05f829e5c9a2761a9a1c
4
- data.tar.gz: 367744a4344284fd502ee1c5aaac46d5308ad534
3
+ metadata.gz: 5c54c79b99314f16b3c9b00441a76daa37163ccc
4
+ data.tar.gz: 94549012ed16ef815d480e77effe0ba27d55223c
5
5
  SHA512:
6
- metadata.gz: 7b5ec3025f3cb6ea81691aedb52b47104846ffaa9c36c6f41d995b0eb358ac95660780851db208d0a158be3b70e6f4a80c52c0c6010febd157eff939f6123f75
7
- data.tar.gz: 65ccfbdc8c07b8e82784fe493f5cd4c3bdc0f2ee6c3159d2fac61e9ea64c569d8d9fb44b0af9879dd9cfe992bea905e403f5f136b1bdced7e5a38ca43275070e
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 == 'function' ) {
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 == 0 && this.options.preload && this.options.select_first_value && this.possibleValues.length > 0 ) {
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
- if( that.options.multiple ) {
588
- that.valueElement.entityArray('clear');
589
- }
590
- that._setValues(values);
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 == 0 )
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
  }
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.1.24'
2
+ VERSION = '0.1.25'
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.24
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-10 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails