redmine_extensions 0.1.19 → 0.1.20

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: 0ba48bfb93ec67f9d2f85ebf393380bb394314bd
4
- data.tar.gz: fc1fbaf825cc44a9c74172db84450f0b39b899f4
3
+ metadata.gz: 2ea7e94b5e3a4174383f226888b122d12d6bdac8
4
+ data.tar.gz: 24b74598a5af55abd7baaf2f96f7bba9a4c9c231
5
5
  SHA512:
6
- metadata.gz: 0b1f66f89cd8442752219382fa0f6d26dc132fe61d149d1a34a7540a2e830cab44c3f491056508cf327857d7dce6831cca41685e1dad14a1225846b21570a95c
7
- data.tar.gz: 10a8b490f51e89f8eb8a362a8fe46fa0dac25d64d214790f47919f6154aa0dddd6dfaf22af2cae97de370e71352bbf0312c6d596208192a7df1eba3d711e0e6c
6
+ metadata.gz: 9ad76f9f3ed6bcf6f4f40d3930d793db31ce9f1b1ed48ff201b01d957a606aeab9f0c7a9484e3eec2ec405f603d310ac7d9df878e4d3e80916948869660f7032
7
+ data.tar.gz: a18f8e004d97d973dd17ffb7abd0559ba0bf111debea7a913226bf3c73eb797a2e3af2f09ff058bab139f4a0751df6991d03a440f09174010bdb325d473ce40b
@@ -315,6 +315,7 @@ window.closeFlashMessage = (function($element){
315
315
  preload: true, // load all possible values
316
316
  position: {collision: 'flip'},
317
317
  autofocus: false,
318
+ combo: false,
318
319
  inputName: null, // defaults to element prop name
319
320
  render_item: function(ul, item) {
320
321
  return $("<li>")
@@ -435,10 +436,18 @@ window.closeFlashMessage = (function($element){
435
436
  },
436
437
  change: function(event, ui) {
437
438
  if (!ui.item) {
438
- $(this).val('');
439
- if( !that.options.multiple ) {
440
- that.valueElement.val('');
441
- that.valueElement.change();
439
+ if (that.options.combo) {
440
+ $(this).val(that.element.val());
441
+ if (!that.options.multiple) {
442
+ that.valueElement.val(that.element.val());
443
+ that.valueElement.change();
444
+ }
445
+ } else {
446
+ $(this).val('');
447
+ if (!that.options.multiple) {
448
+ that.valueElement.val('');
449
+ that.valueElement.change();
450
+ }
442
451
  }
443
452
  }
444
453
  },
@@ -227,7 +227,7 @@ module RedmineExtensions
227
227
  # * +rootElement+ - Has sence only if jsonpath is used for available values. It tells if the json response has values wrapped under root element.
228
228
  # For response like <tt>{projects: [[<name>, <id>], [<name2>, <id2>]]}</tt> user option <tt>rootElement: 'projects'</tt>
229
229
  def autocomplete_field_tag(name, jsonpath_or_array, selected_values, options = {})
230
- options.reverse_merge!({select_first_value: false, show_toggle_button: false, load_immediately: false, preload: true, multiple: true})
230
+ options.reverse_merge!({select_first_value: false, show_toggle_button: false, load_immediately: false, preload: true, multiple: true, combo: false})
231
231
  options[:id] ||= sanitize_to_id(name)
232
232
 
233
233
  selected_values ||= []
@@ -240,7 +240,7 @@ module RedmineExtensions
240
240
 
241
241
  content_tag(:span, :class => 'easy-multiselect-tag-container') do
242
242
  text_field_tag('', '', (options[:html_options] || {}).merge(id: options[:id])) +
243
- javascript_tag("$('##{options[:id]}').easymultiselect({multiple: #{options[:multiple]}, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: #{options[:preload]}, source: #{source}, selected: #{selected_values.to_json}, show_toggle_button: #{options[:show_toggle_button]}, select_first_value: #{options[:select_first_value]}, load_immediately: #{options[:load_immediately]}, autocomplete_options: #{(options[:jquery_auto_complete_options]||{}).to_json} });")
243
+ javascript_tag("$('##{options[:id]}').easymultiselect({multiple: #{options[:multiple]}, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: #{options[:preload]}, combo: #{options[:combo]}, source: #{source}, selected: #{selected_values.to_json}, show_toggle_button: #{options[:show_toggle_button]}, select_first_value: #{options[:select_first_value]}, load_immediately: #{options[:load_immediately]}, autocomplete_options: #{(options[:jquery_auto_complete_options]||{}).to_json} });")
244
244
  end
245
245
  end
246
246
 
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.1.19'
2
+ VERSION = '0.1.20'
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.19
4
+ version: 0.1.20
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-02-21 00:00:00.000000000 Z
11
+ date: 2017-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails