Skip to content

Commit

Permalink
move window onload function into js file luyadev#1481 fix luyadev#1460
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7ch committed Sep 12, 2017
1 parent 4d7fd6f commit 8f650f6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 6 additions & 4 deletions modules/admin/src/resources/dist/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ var observeLogin = function (form, url, secureUrl) {
});
};

$(window).load(function () {
$('.login-logo').addClass('login-logo-loaded');
$('.login-form').addClass('login-form-loaded');
});

var checkInputLabels = function () {
var $loginInput = $('.login-input');
Expand All @@ -117,4 +113,10 @@ var checkInputLabels = function () {
});
};

$(window).load(function () {
$('.login-logo').addClass('login-logo-loaded');
$('.login-form').addClass('login-form-loaded');
checkInputLabels();
});


10 changes: 6 additions & 4 deletions modules/admin/src/resources/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ var observeLogin = function (form, url, secureUrl) {
});
};

$(window).load(function () {
$('.login-logo').addClass('login-logo-loaded');
$('.login-form').addClass('login-form-loaded');
});

var checkInputLabels = function () {
var $loginInput = $('.login-input');
Expand All @@ -117,4 +113,10 @@ var checkInputLabels = function () {
});
};

$(window).load(function () {
$('.login-logo').addClass('login-logo-loaded');
$('.login-form').addClass('login-form-loaded');
checkInputLabels();
});


4 changes: 1 addition & 3 deletions modules/admin/src/views/login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,4 @@
<a href="https://twitter.com/luyadev" target="_blank" class="login-link">@luyadev</a>
</li>
</ul>
</div>

<? $this->registerJS('$(window).load(function () { checkInputLabels();});'); ?>
</div>

0 comments on commit 8f650f6

Please sign in to comment.