recordselect 4.0.15 → 4.0.16
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 +4 -4
- data/app/assets/javascripts/record_select.js +55 -55
- data/lib/record_select/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c273c9f1bd3c8c8135204b82be1780591b2ef96383826f0f366d9d972588eee
|
|
4
|
+
data.tar.gz: 624b5fe2bb099bce6621ed48f7dff1193aef74dfaea422c6f409d4f419007990
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9727bbd6b64bef6b6763d6b76aa7b02c8e11f3efbd920153b8dd91f89cf6359805c6c945d5364c9440c3ca963a6c3c807f57c55584f43c4b74be952165e740fe
|
|
7
|
+
data.tar.gz: b987d403f755fffc2bb574110a5cd179093aa9970d61db924fcbc89577d254ae984ce6898dfe54c3307858522c6e3d552673a05632ff48ab51baa69bf895dc52
|
|
@@ -113,61 +113,6 @@
|
|
|
113
113
|
window.RecordSelect = new Object();
|
|
114
114
|
RecordSelect.document_loaded = false;
|
|
115
115
|
|
|
116
|
-
jQuery(document).ready(function() {
|
|
117
|
-
RecordSelect.document_loaded = true;
|
|
118
|
-
jQuery('[data-rs-type]').each(function() { RecordSelect.from_attributes(jQuery(this)); });
|
|
119
|
-
jQuery(document).on('click', 'div.record-select li.record', function(event) {
|
|
120
|
-
var link = jQuery(this);
|
|
121
|
-
if (link.length) {
|
|
122
|
-
RecordSelect.select_item(link);
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
return true;
|
|
126
|
-
});
|
|
127
|
-
jQuery(document).on('click', '.record-select-option .remove', function(event) {
|
|
128
|
-
var line = jQuery(this).parent(), value = line.find(':input:hidden').val();
|
|
129
|
-
line.parent().data('recordselect').obj.trigger('recordselect:remove', [value]);
|
|
130
|
-
line.remove();
|
|
131
|
-
return false;
|
|
132
|
-
});
|
|
133
|
-
jQuery(document).on('ajax:beforeSend', '.record-select-container', function(event, xhr) {
|
|
134
|
-
var rs = jQuery(this).data('recordselect'), cur = rs.current_xhr, found = jQuery(this).find('.found');
|
|
135
|
-
jQuery(this).find('.record, .pagination').remove();
|
|
136
|
-
found.html(found.data('searching'));
|
|
137
|
-
rs.current_xhr = xhr;
|
|
138
|
-
console.log(rs.current_xhr);
|
|
139
|
-
if (cur) cur.abort();
|
|
140
|
-
});
|
|
141
|
-
jQuery(document).on('ajax:complete', '.record-select-container', function(event, xhr, status) {
|
|
142
|
-
var rs = jQuery(this).data('recordselect');
|
|
143
|
-
if (status != 'abort' || rs.current_xhr == xhr) {
|
|
144
|
-
if (rs.is_open()) rs.show();
|
|
145
|
-
rs.current_xhr = null;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
jQuery(document).on('click', 'input.recordselect ~ .clear-input-button', function(event) {
|
|
149
|
-
var $clear_button = jQuery(event.target), $input = $clear_button.prevAll('input');
|
|
150
|
-
if (!$input.length) return;
|
|
151
|
-
$input.val('').removeClass('selected');
|
|
152
|
-
$clear_button.removeClass('enabled');
|
|
153
|
-
});
|
|
154
|
-
jQuery(document).on('input recordselect:change', 'input.recordselect', function(event) {
|
|
155
|
-
var $clear_button = jQuery(event.target).nextAll('.clear-input-button').first();
|
|
156
|
-
if (!$clear_button.length) return;
|
|
157
|
-
if (jQuery(event.target).val()) $clear_button.addClass('enabled');
|
|
158
|
-
else $clear_button.removeClass('enabled');
|
|
159
|
-
});
|
|
160
|
-
jQuery(document).on('ajax:beforeSend', 'a.rs-mode', function() {
|
|
161
|
-
jQuery(this).closest('.record-select').find('form input[name="rs_mode"]').val(jQuery(this).data('value'));
|
|
162
|
-
});
|
|
163
|
-
jQuery(document).on('focus', 'input.recordselect', function() {
|
|
164
|
-
jQuery(this).prop('focused', true);
|
|
165
|
-
});
|
|
166
|
-
jQuery(document).on('blur', 'input.recordselect', function() {
|
|
167
|
-
jQuery(this).prop('focused', false);
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
|
|
171
116
|
RecordSelect.from_attributes = function(item) {
|
|
172
117
|
if (item.prop('disabled')) return;
|
|
173
118
|
var rs_class = RecordSelect[item.attr('data-rs-type')];
|
|
@@ -635,6 +580,61 @@
|
|
|
635
580
|
this.list_container.prepend(entry)
|
|
636
581
|
}
|
|
637
582
|
});
|
|
583
|
+
|
|
584
|
+
jQuery(document).ready(function() {
|
|
585
|
+
RecordSelect.document_loaded = true;
|
|
586
|
+
jQuery('[data-rs-type]').each(function() { RecordSelect.from_attributes(jQuery(this)); });
|
|
587
|
+
jQuery(document).on('click', 'div.record-select li.record', function(event) {
|
|
588
|
+
var link = jQuery(this);
|
|
589
|
+
if (link.length) {
|
|
590
|
+
RecordSelect.select_item(link);
|
|
591
|
+
return false;
|
|
592
|
+
}
|
|
593
|
+
return true;
|
|
594
|
+
});
|
|
595
|
+
jQuery(document).on('click', '.record-select-option .remove', function(event) {
|
|
596
|
+
var line = jQuery(this).parent(), value = line.find(':input:hidden').val();
|
|
597
|
+
line.parent().data('recordselect').obj.trigger('recordselect:remove', [value]);
|
|
598
|
+
line.remove();
|
|
599
|
+
return false;
|
|
600
|
+
});
|
|
601
|
+
jQuery(document).on('ajax:beforeSend', '.record-select-container', function(event, xhr) {
|
|
602
|
+
var rs = jQuery(this).data('recordselect'), cur = rs.current_xhr, found = jQuery(this).find('.found');
|
|
603
|
+
jQuery(this).find('.record, .pagination').remove();
|
|
604
|
+
found.html(found.data('searching'));
|
|
605
|
+
rs.current_xhr = xhr;
|
|
606
|
+
console.log(rs.current_xhr);
|
|
607
|
+
if (cur) cur.abort();
|
|
608
|
+
});
|
|
609
|
+
jQuery(document).on('ajax:complete', '.record-select-container', function(event, xhr, status) {
|
|
610
|
+
var rs = jQuery(this).data('recordselect');
|
|
611
|
+
if (status != 'abort' || rs.current_xhr == xhr) {
|
|
612
|
+
if (rs.is_open()) rs.show();
|
|
613
|
+
rs.current_xhr = null;
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
jQuery(document).on('click', 'input.recordselect ~ .clear-input-button', function(event) {
|
|
617
|
+
var $clear_button = jQuery(event.target), $input = $clear_button.prevAll('input');
|
|
618
|
+
if (!$input.length) return;
|
|
619
|
+
$input.val('').removeClass('selected');
|
|
620
|
+
$clear_button.removeClass('enabled');
|
|
621
|
+
});
|
|
622
|
+
jQuery(document).on('input recordselect:change', 'input.recordselect', function(event) {
|
|
623
|
+
var $clear_button = jQuery(event.target).nextAll('.clear-input-button').first();
|
|
624
|
+
if (!$clear_button.length) return;
|
|
625
|
+
if (jQuery(event.target).val()) $clear_button.addClass('enabled');
|
|
626
|
+
else $clear_button.removeClass('enabled');
|
|
627
|
+
});
|
|
628
|
+
jQuery(document).on('ajax:beforeSend', 'a.rs-mode', function() {
|
|
629
|
+
jQuery(this).closest('.record-select').find('form input[name="rs_mode"]').val(jQuery(this).data('value'));
|
|
630
|
+
});
|
|
631
|
+
jQuery(document).on('focus', 'input.recordselect', function() {
|
|
632
|
+
jQuery(this).prop('focused', true);
|
|
633
|
+
});
|
|
634
|
+
jQuery(document).on('blur', 'input.recordselect', function() {
|
|
635
|
+
jQuery(this).prop('focused', false);
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
638
|
};
|
|
639
639
|
|
|
640
640
|
if (window.jQuery) {
|