kea-rails 1.0.6 → 1.0.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f645cfadfa538e89cf9f5f7e362bc779f0e3ce3c
4
- data.tar.gz: 68dba0ad42571677101333ed18d5c861d304c437
3
+ metadata.gz: 3aa013e5c44870c868d67d3fd66427ab6f076c1c
4
+ data.tar.gz: 629e172acfeb6784562c7e58093b5fa6ea3203ee
5
5
  SHA512:
6
- metadata.gz: 07cf2f2dc1e0382f5e36b6e398d033c66c8800fdc121d9928c212f0a78a9cd2c0f1d782f907fececf5a41be3fd0d157c974e6d1a2b9b354366d08d4d88353577
7
- data.tar.gz: 84550e9b88270359226bfdd8d01e94349c2d4ab8c9bda531200b770ad5e6dc8fc0098997d2549b0b358b7d8043f064fa87e8c27005ca90572939874f19d8accd
6
+ metadata.gz: e9a6f3eb0e2d9ea58e4b3ab79ea4f71e9030396731854616cb12d0606217a1d27b55b1d146ecb9acf10003b829c8f470ffa9e7c04ffad3aa57327feb8de252da
7
+ data.tar.gz: 695f3a9528477f023468e3a4c631a2eca29e9f993631f95ce822695c8f61e30a2b2d73883352783a91f491828081affe279c1954d8b9a77e774480ee735d9431
@@ -0,0 +1,66 @@
1
+ (function(ko, $) {
2
+ "use strict";
3
+
4
+ ko.bindingHandlers.popover = {
5
+ init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
6
+ var options,
7
+ childVmName,
8
+ parentVm,
9
+ childVmSetupContext,
10
+ childVm,
11
+ clickHandler;
12
+
13
+ if (typeof ko.unwrap(valueAccessor()) === 'string') {
14
+ childVmName = ko.unwrap(valueAccessor());
15
+ parentVm = bindingContext.$parent;
16
+ childVmSetupContext = bindingContext.$data;
17
+
18
+ } else {
19
+ options = ko.unwrap(valueAccessor());
20
+
21
+ childVmName = options.name;
22
+ parentVm = options.parentVm ? options.parentVm : bindingContext.$parent;
23
+ childVmSetupContext = options.setupContext ? options.setupContext : bindingContext.$data;
24
+ }
25
+
26
+ childVm = parentVm.getVm(childVmName);
27
+
28
+ if (typeof childVm.setup === 'function') {
29
+
30
+ clickHandler = function clickHandler() {
31
+ childVm.setup(childVmSetupContext);
32
+ };
33
+
34
+ ko.bindingHandlers.click.init(element, function() { return clickHandler; }, allBindingsAccessor, viewModel, bindingContext);
35
+ }
36
+
37
+ return ko.bindingHandlers.attache.init(element, function() { return childVm; }, allBindingsAccessor, viewModel, bindingContext);
38
+ },
39
+ update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
40
+ var options,
41
+ childVmName,
42
+ parentVm,
43
+ childVm,
44
+ submitComplete;
45
+
46
+ if (typeof ko.unwrap(valueAccessor()) === 'string') {
47
+ childVmName = ko.unwrap(valueAccessor());
48
+ parentVm = bindingContext.$parent;
49
+
50
+ } else {
51
+ options = ko.unwrap(valueAccessor());
52
+
53
+ childVmName = options.name;
54
+ parentVm = options.parentVm ? options.parentVm : bindingContext.$parent;
55
+ }
56
+
57
+ childVm = parentVm.getVm(childVmName);
58
+ submitComplete = ko.unwrap(childVm.submitComplete);
59
+
60
+ if (submitComplete) {
61
+ $(element).attache().hide();
62
+ }
63
+ }
64
+ };
65
+
66
+ })(ko, $);
@@ -9,12 +9,13 @@
9
9
  sherlockVm;
10
10
 
11
11
  sherlockVm = new app.sherlock.SherlockVm();
12
- sherlockVm.setup(options);
13
12
 
14
13
  sherlockVm.params.subscribe(function(params) {
15
14
  bindingContext.$data.sherlockParams(params);
16
15
  });
17
16
 
17
+ sherlockVm.setup(options);
18
+
18
19
  ko.renderTemplate('sherlock-container-template', sherlockVm, {}, element);
19
20
 
20
21
  $container.addClass('sherlock-search-bar');
@@ -1,4 +1,5 @@
1
1
  //= require_directory ./bindings
2
+ //= require attachejs/attache-knockout
2
3
  //= require_directory ./extenders
3
4
  //= require_directory ./components
4
5
  //= require ./models/base
@@ -8,6 +9,7 @@
8
9
  //= require ./overlay/overlay_control
9
10
  //= require ./overlay/overlay_template
10
11
  //= require ./overlay/child_vm_overlay
12
+ //= require ./overlay/close_overlay
11
13
 
12
14
  //= require ./viewmodels/sherlock
13
15
  //= require ./sherlock/base_provider
@@ -0,0 +1,16 @@
1
+ (function(ko, $, Veil, Overlay, app) {
2
+ "use strict";
3
+
4
+ ko.bindingHandlers.closeOverlay = {
5
+ init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
6
+ var $element = $(element);
7
+
8
+ $element.on('click', function(e) {
9
+ bindingContext.overlay.hide();
10
+
11
+ e.preventDefault();
12
+ });
13
+ }
14
+ };
15
+
16
+ })(ko, $, window.Veil, window.Overlay, window.app);
@@ -27,6 +27,16 @@
27
27
  }
28
28
  });
29
29
 
30
+ if ( this.options() ) {
31
+ if (this.options().presetParameters) {
32
+ params = $.extend({}, this.options().presetParameters, params);
33
+ }
34
+
35
+ if (this.options().fixedParameters) {
36
+ params = $.extend({}, params, this.options().fixedParameters);
37
+ }
38
+ }
39
+
30
40
  return params;
31
41
 
32
42
  }, this, {deferEvaluation: true});
@@ -1,3 +1,3 @@
1
1
  module Kea
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kea-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan-Christian Foeh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,6 +37,7 @@ files:
37
37
  - app/assets/javascripts/kea/bindings/activity.js
38
38
  - app/assets/javascripts/kea/bindings/child_vm.js
39
39
  - app/assets/javascripts/kea/bindings/komplete.js
40
+ - app/assets/javascripts/kea/bindings/popover.js
40
41
  - app/assets/javascripts/kea/bindings/sherlock.js
41
42
  - app/assets/javascripts/kea/bindings/sherlock_provider_search.js
42
43
  - app/assets/javascripts/kea/bindings/submit_button.js
@@ -59,6 +60,7 @@ files:
59
60
  - app/assets/javascripts/kea/kea_init.js
60
61
  - app/assets/javascripts/kea/models/base.js
61
62
  - app/assets/javascripts/kea/overlay/child_vm_overlay.js
63
+ - app/assets/javascripts/kea/overlay/close_overlay.js
62
64
  - app/assets/javascripts/kea/overlay/overlay_control.js
63
65
  - app/assets/javascripts/kea/overlay/overlay_template.js
64
66
  - app/assets/javascripts/kea/services/base.js