mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-13 16:54:01 +02:00
Publish tests.
This commit is contained in:
23
test/util/pin.js
Normal file
23
test/util/pin.js
Normal file
@@ -0,0 +1,23 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var htmlClasses;
|
||||
var $pinnedElements;
|
||||
|
||||
function pinHtml() {
|
||||
|
||||
htmlClasses = $('html').attr('class');
|
||||
$pinnedElements = $('head,body').children();
|
||||
}
|
||||
|
||||
function restoreHtml() {
|
||||
|
||||
$('html').attr('class', htmlClasses);
|
||||
$('head,body').children().not($pinnedElements).remove();
|
||||
}
|
||||
|
||||
window.util = window.util || {};
|
||||
window.util.pinHtml = pinHtml;
|
||||
window.util.restoreHtml = restoreHtml;
|
||||
|
||||
}());
|
Reference in New Issue
Block a user