On resize management

This commit is contained in:
2019-04-09 22:34:56 +02:00
parent d8a938af31
commit 5983cab494
8 changed files with 79 additions and 79 deletions

View File

@@ -14,15 +14,12 @@
<div id="feedback"></div>
</div>
<script type="text/javascript">
oSpot.pageInit = function(asHash) {
self.get(
'get_admin',
function(asData){
setProjects(asData.projects);
},
{},
function(e){console.log(e);}
}
);
};
@@ -59,8 +56,9 @@ function setProjects(asProjects) {
function commit(event, $This) {
$This = $This || $(this);
var sOldVal = $This.data('old_value');
var sNewVal = $This.val();
if($This.data('old_value')!=sNewVal) {
if(sOldVal!=sNewVal) {
$This.data('old_value', sNewVal);
var asInputs = {project_id: $This.closest('tr').data('project_id'), field: $This.attr('name'), value: sNewVal};
@@ -72,6 +70,7 @@ function commit(event, $This) {
},
asInputs,
function(sError){
$This.data('old_value', sOldVal);
oSpot.onFeedback('error', sError, asInputs);
}
);
@@ -80,6 +79,6 @@ function commit(event, $This) {
function waitAndCommit(event) {
if(typeof self.tmp('wait') != 'undefined') clearTimeout(self.tmp('wait'));
self.tmp('wait', setTimeout(()=>{commit(event,$(this));}, 1000));
self.tmp('wait', setTimeout(()=>{commit(event,$(this));}, 2000));
}
</script>