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

Commit d07183f

Browse files
committed
Merge pull request #22 from sakshityagi/master
Shown the loading message till the page not completely loaded
2 parents 10569e6 + 834c6a9 commit d07183f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

widget/index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<body class="no-scroll" ng-controller="webviewPluginCtrl" ng-cloak>
2929
<div class="scrollable"
3030
ng-if="(data.content.view == 'Native In App') || data.content.openInApp">
31+
<p ng-if="loading" style="position: absolute; top: 0; display: inline-block; width: 100%; left: 0; background: #eee; text-align: center; color: #333;">Loading....</p>
3132
<iframe ng-src="{{ url }}"
3233
style="height:100%; width:1px; min-width:100%;"
3334
scrolling="auto"
@@ -61,10 +62,10 @@ <h2>Success!</h2>
6162
}]);
6263

6364
webviewPluginApp.controller('webviewPluginCtrl', ["$scope", "$sce", function ($scope, $sce) {
64-
buildfire.spinner.show();
65-
6665
function dataLoadedHandler(result) {
6766
var content = null;
67+
$scope.loading = 1;
68+
buildfire.spinner.show();
6869
console.log("________________", result);
6970
if (result && result.data && !angular.equals({}, result.data)) {
7071
if (result.data.content) {
@@ -128,8 +129,8 @@ <h2>Success!</h2>
128129

129130

130131
buildfire.navigation.onBackButtonClick = function () {
131-
132-
var oldUrl = history.pop();
132+
buildfire.navigation._goBackOne();
133+
/* var oldUrl = history.pop();
133134
var webviewIframe = document.getElementById("webviewIframe");
134135
try {
135136
if (webviewIframe && oldUrl == webviewIframe.contentWindow.location.href)
@@ -147,10 +148,12 @@ <h2>Success!</h2>
147148
} else {
148149
buildfire.navigation.restoreBackButtonClick();
149150
buildfire.navigation.goBack();
150-
}
151+
}*/
151152
};
152153

153154
$scope.iframeLoadedCallBack = function () {
155+
$scope.loading = 0
156+
$scope.$apply();
154157
var webviewIframe = document.getElementById("webviewIframe");
155158
buildfire.spinner.hide();
156159
if (!isBackClicked) {
@@ -178,6 +181,7 @@ <h2>Success!</h2>
178181

179182
buildfire.datastore.onUpdate(function (result) {
180183
dataLoadedHandler(result);
184+
$scope.loading = 0
181185
});
182186
}]);
183187
</script>

0 commit comments

Comments
 (0)