mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-08 14:56:35 +02:00
Clean code.
This commit is contained in:
@@ -23,19 +23,11 @@ describe('module \'' + ID + '\'', function () {
|
||||
|
||||
return this.definition.fn(_, this.xEvent, this.xSettings);
|
||||
};
|
||||
|
||||
this.titleBak = document.title;
|
||||
this.dummyTitle = util.uniqId();
|
||||
});
|
||||
|
||||
after(function () {
|
||||
|
||||
document.title = this.titleBak;
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
document.title = this.dummyTitle;
|
||||
util.restoreHtml();
|
||||
});
|
||||
|
||||
describe('definition', function () {
|
||||
|
@@ -1,17 +1,20 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var title;
|
||||
var htmlClasses;
|
||||
var $pinnedElements;
|
||||
|
||||
function pinHtml() {
|
||||
|
||||
title = document.title;
|
||||
htmlClasses = $('html').attr('class');
|
||||
$pinnedElements = $('head,body').children();
|
||||
}
|
||||
|
||||
function restoreHtml() {
|
||||
|
||||
document.title = title;
|
||||
$('html').attr('class', htmlClasses);
|
||||
$('head,body').children().not($pinnedElements).remove();
|
||||
}
|
||||
|
Reference in New Issue
Block a user