1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00

Minor JS adjustments

This commit is contained in:
Ryan Cramer
2022-10-06 13:20:17 -04:00
parent 96bb90bb2e
commit d2bdf70ecd
8 changed files with 11 additions and 6 deletions

View File

@@ -1145,6 +1145,10 @@ function InputfieldRepeater($) {
}); });
$(this).closest('.InputfieldRepeater').trigger('sorted', [ ui.item ]); $(this).closest('.InputfieldRepeater').trigger('sorted', [ ui.item ]);
},
update: function(e, ui) {
$inputfieldRepeater.addClass('InputfieldStateChanged');
} }
}; };

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,3 @@
$(document).ready(function() { $(document).ready(function() {
/** /**

File diff suppressed because one or more lines are too long

View File

@@ -572,7 +572,7 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
protected function renderListReady($value) { protected function renderListReady($value) {
if(!$this->renderValueMode) { if(!$this->renderValueMode) {
// if just rendering the files list (as opposed to saving it), delete any temp files that may have accumulated // if just rendering the files list (as opposed to saving it), delete any temp files that may have accumulated
if(!$this->overwrite && !count($_POST) && !$this->isAjax && !$this->uploadOnlyMode) { if(!$this->overwrite && !count($_POST) && !$this->isAjax && !$this->uploadOnlyMode && !$this->wire()->config->ajax) {
$input = $this->wire()->input; $input = $this->wire()->input;
// don't delete files when in render single field or fields mode // don't delete files when in render single field or fields mode
if(!$input->get('field') && !$input->get('fields')) { if(!$input->get('field') && !$input->get('fields')) {

View File

@@ -2341,10 +2341,12 @@ function InputfieldImage($) {
$(document).on('reloaded', '.InputfieldImage', function() { $(document).on('reloaded', '.InputfieldImage', function() {
var $inputfield = $(this); var $inputfield = $(this);
$inputfield.removeClass('InputfieldImageInit');
initInputfield($inputfield); initInputfield($inputfield);
initUploadHTML5($inputfield); initUploadHTML5($inputfield);
//console.log('InputfieldImage reloaded'); //console.log('InputfieldImage reloaded');
Inputfields.init($inputfield); Inputfields.init($inputfield);
$('.InputfieldImageListToggle--active', $inputfield).click();
}).on('wiretabclick', function(e, $newTab, $oldTab) { }).on('wiretabclick', function(e, $newTab, $oldTab) {
$newTab.find(".InputfieldImage").each(function() { $newTab.find(".InputfieldImage").each(function() {
initInputfield($(this)); initInputfield($(this));

File diff suppressed because one or more lines are too long

View File

@@ -55,7 +55,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
return array( return array(
'title' => __('Images', __FILE__), // Module Title 'title' => __('Images', __FILE__), // Module Title
'summary' => __('One or more image uploads (sortable)', __FILE__), // Module Summary 'summary' => __('One or more image uploads (sortable)', __FILE__), // Module Summary
'version' => 124, 'version' => 125,
'permanent' => true, 'permanent' => true,
); );
} }