hydra-editor 1.0.1 → 1.0.2

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: badb7f0fbdff55bb350f6f5936d5d8ed3e2711c8
4
- data.tar.gz: 3c5228ce3d7cbd7f7ac9781b24f7d875bd8c2deb
3
+ metadata.gz: 04c5fb944277294ad7c68f7c47000c80618df2e5
4
+ data.tar.gz: fdd50431f94480d6b0478bb8baf61023a7008607
5
5
  SHA512:
6
- metadata.gz: a980671cd06cd67161aaf8e14b4fab6b9b72a6a60a765ef14990887bedb86ab0ebadc54477a40701e0c36b6c1e98390b3f17d97334d9cb036b069d0da41be356
7
- data.tar.gz: 1d839077acae5f90f518e7413c0dce2a7a2688ee96c7e87e1c5b89aee8180bdc83b42a79447f09a6c3ab23ba818f5c4a406ad1da02c79e6b34ce39f52ac93452
6
+ metadata.gz: 41c5f95fb5063b9a9bf5104f687e922dbecb503401446d40a828c3463edb8728d464c58066e56a8b42f4bb723c698b2718b6064d31ec79c69d26783579f3973d
7
+ data.tar.gz: 4a689b42e096053eb2a4897c0c826206b1cda8deb3c3d8b5829ce4547f6346a5d29342d9c346d29e8f08a8cc83b16ba93f40677ae53371d45d1112ec7c5a2ceb
data/History.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # History of hydra-editor releases
2
2
 
3
+ ## 1.0.2
4
+ * Update javascript to be more selective about which fields cause an error when blank
5
+
3
6
  ## 0.0.2
4
7
  * Requiring active-fedora >= 6.3.0 in order to have the .required? method on ActiveFedora::Base:q
5
8
 
@@ -40,10 +40,10 @@ var HydraEditor = (function($) {
40
40
  _attachEvents: function() {
41
41
  var _this = this;
42
42
  this.element.on('click', '.remove', function (e) {
43
- _this.remove_from_list(e);
43
+ _this.removeFromList(e);
44
44
  });
45
45
  this.element.on('click', '.add', function (e) {
46
- _this.add_to_list(e);
46
+ _this.addToList(e);
47
47
  });
48
48
  },
49
49
 
@@ -52,19 +52,23 @@ var HydraEditor = (function($) {
52
52
  this.element.bind('managed_field:remove', this.options.remove);
53
53
  },
54
54
 
55
- add_to_list: function( event ) {
55
+ addToList: function( event ) {
56
56
  event.preventDefault();
57
57
  var $activeField = $(event.target).parents(this.fieldWrapperClass)
58
58
 
59
- if ($activeField.children('input').val() === '') {
59
+ if (this.inputIsEmpty($activeField)) {
60
60
  this.displayEmptyWarning();
61
61
  } else {
62
- var $listing = $(this.listClass, this.element);
63
- this.clearEmptyWarning();
64
- $listing.append(this._newField($activeField));
62
+ var $listing = $(this.listClass, this.element);
63
+ this.clearEmptyWarning();
64
+ $listing.append(this._newField($activeField));
65
65
  }
66
66
  },
67
67
 
68
+ inputIsEmpty: function($activeField) {
69
+ return $activeField.children('input.multi-text-field').val() === '';
70
+ },
71
+
68
72
  _newField: function ($activeField) {
69
73
  var $newField = this.createNewField($activeField);
70
74
  // _changeControlsToRemove must come after createNewField
@@ -101,7 +105,7 @@ var HydraEditor = (function($) {
101
105
  $listing.append($warningMessage);
102
106
  },
103
107
 
104
- remove_from_list: function( event ) {
108
+ removeFromList: function( event ) {
105
109
  event.preventDefault();
106
110
 
107
111
  var field = $(event.target).parents(this.fieldWrapperClass)
@@ -1,3 +1,3 @@
1
1
  module HydraEditor
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-17 00:00:00.000000000 Z
12
+ date: 2015-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
- rubygems_version: 2.2.2
240
+ rubygems_version: 2.4.5
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: A basic metadata editor for hydra-head