fuelux-rails 2.1.02 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module FueluxRails
2
- VERSION = "2.1.02"
2
+ VERSION = "2.1.3"
3
3
  end
@@ -1,3 +1,4 @@
1
+ //= require fuelux/combobox
1
2
  //= require fuelux/datagrid
2
3
  //= require fuelux/pillbox
3
4
  //= require fuelux/search
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Fuel UX Combobox
3
+ * https://github.com/ExactTarget/fuelux
4
+ *
5
+ * Copyright (c) 2012 ExactTarget
6
+ * Licensed under the MIT license.
7
+ */
8
+
9
+ !function($){
10
+
11
+
12
+ // COMBOBOX CONSTRUCTOR AND PROTOTYPE
13
+
14
+ var Combobox = function (element, options) {
15
+ this.$element = $(element);
16
+ this.options = $.extend({}, $.fn.combobox.defaults, options);
17
+ this.$element.on('click', 'a', $.proxy(this.itemclicked, this));
18
+ this.$input = this.$element.find('input');
19
+ };
20
+
21
+ Combobox.prototype = {
22
+
23
+ constructor: Combobox,
24
+
25
+ select: function (val) {
26
+ this.$input.val(val).change();
27
+ return this;
28
+ },
29
+
30
+ itemclicked: function (e) {
31
+ this.select($(e.target).text());
32
+ $('body').click();
33
+ e.preventDefault();
34
+ }
35
+
36
+ };
37
+
38
+
39
+ // COMBOBOX PLUGIN DEFINITION
40
+
41
+ $.fn.combobox = function (option) {
42
+ return this.each(function () {
43
+ var $this = $(this);
44
+ var data = $this.data('combobox');
45
+ var options = typeof option === 'object' && option;
46
+
47
+ if (!data) $this.data('combobox', (data = new Combobox(this, options)));
48
+ if (typeof option === 'string') data[option]();
49
+ });
50
+ };
51
+
52
+ $.fn.combobox.defaults = {};
53
+
54
+ $.fn.combobox.Constructor = Combobox;
55
+
56
+
57
+ // COMBOBOX DATA-API
58
+
59
+ $(function () {
60
+ $('body').on('mousedown.combobox.data-api', '.combobox', function (e) {
61
+ var $this = $(this);
62
+ if ($this.data('combobox')) return;
63
+ $this.combobox($this.data());
64
+ });
65
+ });
66
+
67
+ }(window.jQuery);
@@ -6,7 +6,8 @@
6
6
  * Licensed under the MIT license.
7
7
  */
8
8
 
9
- !function ($) {
9
+ !function($){
10
+
10
11
 
11
12
  // DATAGRID CONSTRUCTOR AND PROTOTYPE
12
13
 
@@ -2874,6 +2874,7 @@ define('fuelux/search',['require','jquery'],function(require) {
2874
2874
  this.$element = $(element);
2875
2875
  this.options = $.extend({}, $.fn.search.defaults, options);
2876
2876
  this.$element.find('button').on('click', $.proxy(this.buttonclicked, this));
2877
+ this.$input = this.$element.find('input').on('keydown', $.proxy(this.keypress, this));
2877
2878
  this.$input = this.$element.find('input').on('keyup', $.proxy(this.keypressed, this));
2878
2879
  this.$icon = this.$element.find('i');
2879
2880
  this.activeSearch = '';
@@ -2913,6 +2914,12 @@ define('fuelux/search',['require','jquery'],function(require) {
2913
2914
  this.action();
2914
2915
  },
2915
2916
 
2917
+ keypress: function (e) {
2918
+ if (e.which === 13) {
2919
+ e.preventDefault();
2920
+ }
2921
+ },
2922
+
2916
2923
  keypressed: function (e) {
2917
2924
  var val, inputPresentAndUnchanged;
2918
2925
 
@@ -6,8 +6,7 @@
6
6
  * Licensed under the MIT license.
7
7
  */
8
8
 
9
- !function ($) {
10
-
9
+ !function($){
11
10
 
12
11
  // PILLBOX CONSTRUCTOR AND PROTOTYPE
13
12
 
@@ -67,4 +66,3 @@
67
66
  });
68
67
 
69
68
  }(window.jQuery);
70
-
@@ -6,7 +6,7 @@
6
6
  * Licensed under the MIT license.
7
7
  */
8
8
 
9
- !function ($) {
9
+ !function($){
10
10
 
11
11
 
12
12
  // SEARCH CONSTRUCTOR AND PROTOTYPE
@@ -15,6 +15,7 @@
15
15
  this.$element = $(element);
16
16
  this.options = $.extend({}, $.fn.search.defaults, options);
17
17
  this.$element.find('button').on('click', $.proxy(this.buttonclicked, this));
18
+ this.$input = this.$element.find('input').on('keydown', $.proxy(this.keypress, this));
18
19
  this.$input = this.$element.find('input').on('keyup', $.proxy(this.keypressed, this));
19
20
  this.$icon = this.$element.find('i');
20
21
  this.activeSearch = '';
@@ -54,6 +55,12 @@
54
55
  this.action();
55
56
  },
56
57
 
58
+ keypress: function (e) {
59
+ if (e.which === 13) {
60
+ e.preventDefault();
61
+ }
62
+ },
63
+
57
64
  keypressed: function (e) {
58
65
  var val, inputPresentAndUnchanged;
59
66
 
@@ -6,7 +6,7 @@
6
6
  * Licensed under the MIT license.
7
7
  */
8
8
 
9
- !function ($) {
9
+ !function($){
10
10
 
11
11
 
12
12
  // SPINNER CONSTRUCTOR AND PROTOTYPE
@@ -181,4 +181,3 @@
181
181
  });
182
182
 
183
183
  }(window.jQuery);
184
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuelux-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.02
4
+ version: 2.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-06 00:00:00.000000000 Z
12
+ date: 2012-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -105,6 +105,7 @@ files:
105
105
  - lib/fuelux-rails.rb
106
106
  - lib/generators/fuelux/install_generator.rb
107
107
  - lib/tasks/fuelux-rails_tasks.rake
108
+ - vendor/assets/javascripts/fuelux/combobox.js
108
109
  - vendor/assets/javascripts/fuelux/datagrid.js
109
110
  - vendor/assets/javascripts/fuelux/loader.js
110
111
  - vendor/assets/javascripts/fuelux/pillbox.js