Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
57f9ceff
Commit
57f9ceff
authored
Apr 08, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crud callback mask
parent
49366b6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
socket.js
app/zetalib/socket.js
+30
-1
app.js
dist/app.js
+2
-2
No files found.
app/zetalib/socket.js
View file @
57f9ceff
...
...
@@ -25,7 +25,7 @@ angular.module('ulakbus')
/**
* WSOps operates all websocket interactions
*/
.
factory
(
'WSOps'
,
function
(
WSUri
,
$q
,
$log
,
$rootScope
,
$timeou
t
,
ErrorService
,
WS
,
IsOnline
)
{
.
factory
(
'WSOps'
,
function
(
WSUri
,
$q
,
$log
,
$rootScope
,
$timeout
,
$documen
t
,
ErrorService
,
WS
,
IsOnline
)
{
$rootScope
.
$on
(
'ws_turn_on'
,
function
()
{
generate_ws
();
});
...
...
@@ -137,6 +137,9 @@ angular.module('ulakbus')
};
// do_action is the dispatcher function for incoming events
var
do_action
=
function
(
options
)
{
// remove mask from crud here
togglePageReadyMask
(
0
);
$log
.
info
(
"togglePageReadyMask off"
);
var
args
=
[].
slice
.
call
(
arguments
,
0
),
initialized
=
false
,
action
=
'init'
;
...
...
@@ -170,6 +173,9 @@ angular.module('ulakbus')
wsOps
.
callbacks
[
request
.
callbackID
]
=
deferred
;
websocket
.
send
(
angular
.
toJson
(
request
));
$log
.
info
(
'SENT:'
,
data
);
togglePageReadyMask
(
1
);
$log
.
info
(
"togglePageReadyMask on"
);
//
// todo: add success & error promises
return
deferred
.
promise
.
then
(
function
(
response
)
{
request
.
response
=
response
;
...
...
@@ -191,5 +197,28 @@ angular.module('ulakbus')
delete
websocket
;
};
var
pageReady
;
var
mask
=
angular
.
element
(
'<div class="body-mask"><div class="loader"></div>'
+
'</div>'
);
mask
.
css
({
zIndex
:
'2010'
,
opacity
:
'0.6'
});
var
body
=
$document
.
find
(
'body'
).
eq
(
0
);
var
togglePageReadyMask
=
function
(
st
)
{
var
toggle
=
[
function
()
{
if
(
pageReady
===
0
)
{
return
;}
$timeout
(
function
()
{
mask
.
remove
();
pageReady
=
0
;
},
1000
);
},
function
()
{
if
(
pageReady
===
1
)
{
return
;}
body
.
append
(
mask
);
pageReady
=
1
;
}
];
toggle
[
st
]();
};
return
wsOps
;
});
\ No newline at end of file
dist/app.js
View file @
57f9ceff
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment