spotlight-frontend 4.0.3 → 4.2.0

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.
@@ -4056,29 +4056,6 @@
4056
4056
  }
4057
4057
  }
4058
4058
 
4059
- class Appearance {
4060
- connect(){
4061
- $("[data-behavior='restore-default']").each(function(){
4062
- var hidden = $("[data-default-value]", $(this));
4063
- var value = $($("[data-in-place-edit-target]", $(this)).data('in-place-edit-target'), $(this));
4064
- var button = $("[data-restore-default]", $(this));
4065
- hidden.on('blur', function(){
4066
- if( $(this).val() == $(this).data('default-value') ) {
4067
- button.addClass('d-none');
4068
- } else {
4069
- button.removeClass('d-none');
4070
- }
4071
- });
4072
- button.on('click', function(e){
4073
- e.preventDefault();
4074
- hidden.val(hidden.data('default-value'));
4075
- value.text(hidden.data('default-value'));
4076
- button.hide();
4077
- });
4078
- });
4079
- }
4080
- }
4081
-
4082
4059
  class BlacklightConfiguration {
4083
4060
  connect() {
4084
4061
  // Add Select/Deselect all button behavior
@@ -4635,6 +4612,33 @@
4635
4612
  return false;
4636
4613
  });
4637
4614
  });
4615
+
4616
+ $("[data-behavior='restore-default']").each(function(){
4617
+ var hidden = $("[data-default-value]", $(this));
4618
+ var value = $($("[data-in-place-edit-target]", $(this)).data('in-place-edit-target'), $(this));
4619
+ var button = $("[data-restore-default]", $(this));
4620
+
4621
+ hidden.on('keypress', function(e) {
4622
+ if(e.which == 13) {
4623
+ hidden.trigger('blur');
4624
+ return false;
4625
+ }
4626
+ });
4627
+
4628
+ hidden.on('blur', function(){
4629
+ if( $(this).val() == $(this).data('default-value') ) {
4630
+ button.addClass('d-none');
4631
+ } else {
4632
+ button.removeClass('d-none');
4633
+ }
4634
+ });
4635
+ button.on('click', function(e){
4636
+ e.preventDefault();
4637
+ hidden.val(hidden.data('default-value'));
4638
+ value.text(hidden.data('default-value'));
4639
+ button.hide();
4640
+ });
4641
+ });
4638
4642
  }
4639
4643
  }
4640
4644
 
@@ -7171,7 +7175,6 @@
7171
7175
  connect() {
7172
7176
  new AddAnother().connect();
7173
7177
  new AddNewButton().connect();
7174
- new Appearance().connect();
7175
7178
  new CopyEmailAddress().connect();
7176
7179
  new Croppable().connect();
7177
7180
  new EditInPlace().connect();