Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4b6fa94

Browse files
squash - rename DocumentComplete -> DocumentLoaded
1 parent c7ed560 commit 4b6fa94

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/jqLite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ function jqLiteRemove(element, keepData) {
454454
}
455455

456456

457-
function jqLiteDocumentComplete(action, win) {
457+
function jqLiteDocumentLoaded(action, win) {
458458
win = win || window;
459459
if (win.document.readyState === 'complete') {
460460
// Force the action to be run async for consistent behaviour

src/ng/anchorScroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function $AnchorScrollProvider() {
257257
// skip the initial scroll if $location.hash is empty
258258
if (newVal === oldVal && newVal === '') return;
259259

260-
jqLiteDocumentComplete(function() {
260+
jqLiteDocumentLoaded(function() {
261261
$rootScope.$evalAsync(scroll);
262262
});
263263
});

test/jqLiteSpec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,7 @@ describe('jqLite', function() {
19941994
});
19951995

19961996

1997-
describe('jqLiteDocumentComplete', function() {
1997+
describe('jqLiteDocumentLoaded', function() {
19981998

19991999
function createMockWindow(readyState) {
20002000
return {
@@ -2010,7 +2010,7 @@ describe('jqLite', function() {
20102010

20112011
var mockWindow = createMockWindow('complete');
20122012

2013-
jqLiteDocumentComplete(onLoadCallback, mockWindow);
2013+
jqLiteDocumentLoaded(onLoadCallback, mockWindow);
20142014

20152015
expect(mockWindow.addEventListener).not.toHaveBeenCalled();
20162016
expect(mockWindow.setTimeout.mostRecentCall.args[0]).toBe(onLoadCallback);
@@ -2021,7 +2021,7 @@ describe('jqLite', function() {
20212021
var onLoadCallback = jasmine.createSpy('onLoadCallback');
20222022
var mockWindow = createMockWindow();
20232023

2024-
jqLiteDocumentComplete(onLoadCallback, mockWindow);
2024+
jqLiteDocumentLoaded(onLoadCallback, mockWindow);
20252025

20262026
expect(mockWindow.addEventListener).toHaveBeenCalledOnce();
20272027
});
@@ -2031,7 +2031,7 @@ describe('jqLite', function() {
20312031
var onLoadCallback = jasmine.createSpy('onLoadCallback');
20322032
var mockWindow = createMockWindow();
20332033

2034-
jqLiteDocumentComplete(onLoadCallback, mockWindow);
2034+
jqLiteDocumentLoaded(onLoadCallback, mockWindow);
20352035
expect(onLoadCallback).not.toHaveBeenCalled();
20362036

20372037
jqLite(mockWindow).triggerHandler('load');

test/ng/anchorScrollSpec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,28 @@ describe('$anchorScroll', function() {
103103
expect($window.scrollTo).toHaveBeenCalledWith(0, 0);
104104
}
105105

106-
function spyOnJQLiteDocumentComplete(fake) {
106+
function spyOnJQLiteDocumentLoaded(fake) {
107107
return function() {
108-
spyOn(window, 'jqLiteDocumentComplete');
108+
spyOn(window, 'jqLiteDocumentLoaded');
109109
if (fake) {
110-
window.jqLiteDocumentComplete.andCallFake(fake);
110+
window.jqLiteDocumentLoaded.andCallFake(fake);
111111
}
112112
};
113113
}
114114

115-
function unspyOnJQLiteDocumentComplete() {
115+
function unspyOnJQLiteDocumentLoaded() {
116116
return function() {
117-
window.jqLiteDocumentComplete = window.jqLiteDocumentComplete.originalValue;
117+
window.jqLiteDocumentLoaded = window.jqLiteDocumentLoaded.originalValue;
118118
};
119119
}
120120

121-
function simulateDocumentComplete() {
122-
return spyOnJQLiteDocumentComplete(function(callback) { callback(); });
121+
function simulateDocumentLoaded() {
122+
return spyOnJQLiteDocumentLoaded(function(callback) { callback(); });
123123
}
124124

125125
function fireWindowLoadEvent() {
126126
return function($browser) {
127-
var callback = window.jqLiteDocumentComplete.mostRecentCall.args[0];
127+
var callback = window.jqLiteDocumentLoaded.mostRecentCall.args[0];
128128
callback();
129129
$browser.defer.flush();
130130
};
@@ -208,8 +208,8 @@ describe('$anchorScroll', function() {
208208

209209
describe('when document has completed loading', function() {
210210

211-
beforeEach(simulateDocumentComplete());
212-
afterEach(unspyOnJQLiteDocumentComplete());
211+
beforeEach(simulateDocumentLoaded());
212+
afterEach(unspyOnJQLiteDocumentLoaded());
213213

214214
it('should scroll to element when hash change in hashbang mode', function() {
215215
module(initLocation({html5Mode: false, historyApi: true}));
@@ -287,8 +287,8 @@ describe('$anchorScroll', function() {
287287

288288
describe('when document has not completed loading', function() {
289289

290-
beforeEach(spyOnJQLiteDocumentComplete());
291-
afterEach(unspyOnJQLiteDocumentComplete());
290+
beforeEach(spyOnJQLiteDocumentLoaded());
291+
afterEach(unspyOnJQLiteDocumentLoaded());
292292

293293
it('should wait for the document to be completely loaded before auto-scrolling', inject(
294294
addElements('id=some'),
@@ -305,8 +305,8 @@ describe('$anchorScroll', function() {
305305

306306
describe('yOffset', function() {
307307

308-
beforeEach(simulateDocumentComplete());
309-
afterEach(unspyOnJQLiteDocumentComplete);
308+
beforeEach(simulateDocumentLoaded());
309+
afterEach(unspyOnJQLiteDocumentLoaded);
310310

311311
function expectScrollingWithOffset(identifierCountMap, offsetList) {
312312
var list = isArray(offsetList) ? offsetList : [offsetList];

0 commit comments

Comments
 (0)