Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synchronisation de modifyWithoutSave #2745

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions core/js/plugin.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ if (!jeeFrontEnd.pluginTemplate) {
jeedomUtils.addOrUpdateUrl('id', data.id)
domUtils.hideLoading()
jeeFrontEnd.modifyWithoutSave = false
modifyWithoutSave = false
setTimeout(function() {
jeeFrontEnd.modifyWithoutSave = false
modifyWithoutSave = false
}, 1000)

if (window.location.hash == '') document.querySelector('.nav-tabs a:not(.eqLogicAction)')?.click()
Expand Down Expand Up @@ -278,6 +280,7 @@ if (!jeeFrontEnd.pluginTemplate) {
}
}
jeeFrontEnd.modifyWithoutSave = false
modifyWithoutSave = false
url += 'id=' + _data.id + '&saveSuccessFull=1'
jeedomUtils.loadPage(url)
}
Expand Down Expand Up @@ -323,6 +326,7 @@ if (!jeeFrontEnd.pluginTemplate) {
},
success: function(data) {
jeeFrontEnd.modifyWithoutSave = false
modifyWithoutSave = false
var vars = getUrlVars()
var url = 'index.php?'
for (var i in vars) {
Expand All @@ -345,6 +349,7 @@ if (!jeeFrontEnd.pluginTemplate) {

jeedomUtils.loadPage(url)
jeeFrontEnd.modifyWithoutSave = false
modifyWithoutSave = false
}
})
return false
Expand All @@ -369,6 +374,7 @@ if (!jeeFrontEnd.pluginTemplate) {
},
success: function(data) {
jeeFrontEnd.modifyWithoutSave = false
modifyWithoutSave = false
var vars = getUrlVars()
var url = 'index.php?'
for (var i in vars) {
Expand Down Expand Up @@ -591,6 +597,7 @@ domUtils(function() {
chosenClass: 'dragSelected',
onEnd: function(event) {
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
},
})
tableCmd._sortable = jeeFrontEnd.pluginTemplate.cmdSortable
Expand Down Expand Up @@ -703,6 +710,7 @@ document.getElementById('div_pageContainer').addEventListener('click', function(
}
document.querySelectorAll('.cmdAttr[data-l1key="type"]').last().triggerEvent('change')
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
return
}

Expand All @@ -714,13 +722,15 @@ document.getElementById('div_pageContainer').addEventListener('click', function(
jeedomUtils.chooseIcon(function(_icon) {
cmd.querySelector('.cmdAttr[data-l1key="display"][data-l2key="icon"]').empty().innerHTML = _icon
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
}, params)
return
}

if (_target = event.target.closest('.cmd .cmdAction[data-action="remove"]')) {
_target.closest('tr').remove()
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
return
}

Expand All @@ -733,6 +743,7 @@ document.getElementById('div_pageContainer').addEventListener('click', function(
jeeFrontEnd.pluginTemplate.addCmdToTableDefault(cmd)
}
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
return
}

Expand Down Expand Up @@ -785,6 +796,7 @@ document.getElementById('div_pageContainer').addEventListener('dblclick', functi
if (_target = event.target.closest('.cmdAttr[data-l1key="display"][data-l2key="icon"]')) {
_target.innerHTML = ''
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
return
}

Expand All @@ -801,12 +813,18 @@ document.getElementById('div_pageContainer').addEventListener('dblclick', functi
document.getElementById('div_pageContainer').addEventListener('change', function(event) {
var _target = null
if (_target = event.target.closest('.eqLogic .eqLogicAttr')) {
if (_target.isVisible()) jeeFrontEnd.modifyWithoutSave = true
if (_target.isVisible()) {
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
}
return
}

if (_target = event.target.closest('.cmd .cmdAttr')) {
if (_target.isVisible()) jeeFrontEnd.modifyWithoutSave = true
if (_target.isVisible()) {
jeeFrontEnd.modifyWithoutSave = true
modifyWithoutSave = true
}
}

if (_target = event.target.closest('.cmd select.cmdAttr[data-l1key="type"]')) {
Expand Down
Loading