mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-27 13:34:30 -04:00
Add integration test.
This commit is contained in:
parent
ea306c7d0c
commit
70c8364349
5 changed files with 154 additions and 20 deletions
|
@ -2,21 +2,33 @@
|
|||
'use strict';
|
||||
|
||||
var title;
|
||||
var htmlId;
|
||||
var htmlClasses;
|
||||
var bodyId;
|
||||
var bodyClasses;
|
||||
var $pinnedElements;
|
||||
|
||||
function pinHtml() {
|
||||
|
||||
title = document.title;
|
||||
htmlId = $('html').attr('id');
|
||||
htmlClasses = $('html').attr('class');
|
||||
bodyId = $('body').attr('id');
|
||||
bodyClasses = $('body').attr('class');
|
||||
$pinnedElements = $('head,body').children();
|
||||
}
|
||||
|
||||
function restoreHtml() {
|
||||
|
||||
document.title = title;
|
||||
$('html').attr('id', htmlId);
|
||||
$('html').attr('class', htmlClasses);
|
||||
$('body').attr('id', bodyId);
|
||||
$('body').attr('class', bodyClasses);
|
||||
$('head,body').children().not($pinnedElements).remove();
|
||||
if (window.localStorage && window.localStorage.clear) {
|
||||
window.localStorage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
window.util = window.util || {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue