Use throttle to link to support tickets
This commit is contained in:
parent
a9e4af1d12
commit
bba769ef77
@ -206,7 +206,11 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var to;
|
var to = Util.throttle(function () {
|
||||||
|
var $ticket = $div.find('.cp-support-list-ticket[data-id="'+linkedId+'"]');
|
||||||
|
$ticket[0].scrollIntoView();
|
||||||
|
linkedId = undefined;
|
||||||
|
}, 100);
|
||||||
|
|
||||||
// Register to the "support" mailbox
|
// Register to the "support" mailbox
|
||||||
common.mailbox.subscribe(['supportadmin'], {
|
common.mailbox.subscribe(['supportadmin'], {
|
||||||
@ -255,14 +259,7 @@ define([
|
|||||||
$ticket.append(APP.support.makeMessage(content, hash));
|
$ticket.append(APP.support.makeMessage(content, hash));
|
||||||
reorder();
|
reorder();
|
||||||
|
|
||||||
if (linkedId) {
|
if (linkedId) { to(); }
|
||||||
clearTimeout(to);
|
|
||||||
to = setTimeout(function () {
|
|
||||||
var $ticket = $div.find('.cp-support-list-ticket[data-id="'+linkedId+'"]');
|
|
||||||
$ticket[0].scrollIntoView();
|
|
||||||
linkedId = undefined;
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return $container;
|
return $container;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user