File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,16 +14,20 @@ function updateLastChange() {
1414}
1515setInterval ( updateLastChange , 60000 ) ;
1616
17- function updateLastChangeUser ( data ) {
18- if ( data . lastchangeuserprofile ) {
19- var icon = lastchangeui . user . children ( 'i' ) ;
20- icon . attr ( 'title' , data . lastchangeuserprofile . name ) . tooltip ( 'fixTitle' ) ;
21- icon . attr ( 'style' , 'background-image:url(' + data . lastchangeuserprofile . photo + ')' ) ;
22- lastchangeui . user . show ( ) ;
23- lastchangeui . nouser . hide ( ) ;
24- } else {
25- lastchangeui . user . hide ( ) ;
26- lastchangeui . nouser . show ( ) ;
17+ var lastchangeuser = null ;
18+ var lastchangeuserprofile = null ;
19+ function updateLastChangeUser ( ) {
20+ if ( lastchangeui ) {
21+ if ( lastchangeuser && lastchangeuserprofile ) {
22+ var icon = lastchangeui . user . children ( 'i' ) ;
23+ icon . attr ( 'title' , lastchangeuserprofile . name ) . tooltip ( 'fixTitle' ) ;
24+ icon . attr ( 'style' , 'background-image:url(' + lastchangeuserprofile . photo + ')' ) ;
25+ lastchangeui . user . show ( ) ;
26+ lastchangeui . nouser . hide ( ) ;
27+ } else {
28+ lastchangeui . user . hide ( ) ;
29+ lastchangeui . nouser . show ( ) ;
30+ }
2731 }
2832}
2933
Original file line number Diff line number Diff line change @@ -1481,10 +1481,21 @@ socket.on('version', function (data) {
14811481 if ( data != version )
14821482 setNeedRefresh ( ) ;
14831483} ) ;
1484+ function updateLastInfo ( data ) {
1485+ //console.log(data);
1486+ if ( lastchangetime !== data . updatetime ) {
1487+ lastchangetime = data . updatetime ;
1488+ updateLastChange ( ) ;
1489+ }
1490+ if ( lastchangeuser !== data . lastchangeuser ) {
1491+ lastchangeuser = data . lastchangeuser ;
1492+ lastchangeuserprofile = data . lastchangeuserprofile ;
1493+ updateLastChangeUser ( ) ;
1494+ }
1495+ }
14841496socket . on ( 'check' , function ( data ) {
1485- lastchangetime = data . updatetime ;
1486- updateLastChange ( ) ;
1487- updateLastChangeUser ( data ) ;
1497+ //console.log(data);
1498+ updateLastInfo ( data ) ;
14881499} ) ;
14891500socket . on ( 'permission' , function ( data ) {
14901501 updatePermission ( data . permission ) ;
@@ -1494,14 +1505,13 @@ var otk = null;
14941505var owner = null ;
14951506var permission = null ;
14961507socket . on ( 'refresh' , function ( data ) {
1508+ //console.log(data);
14971509 docmaxlength = data . docmaxlength ;
14981510 editor . setOption ( "maxLength" , docmaxlength ) ;
14991511 otk = data . otk ;
15001512 owner = data . owner ;
15011513 updatePermission ( data . permission ) ;
1502- lastchangetime = data . updatetime ;
1503- updateLastChange ( ) ;
1504- updateLastChangeUser ( data ) ;
1514+ updateLastInfo ( data ) ;
15051515 if ( ! loaded ) {
15061516 var nocontent = editor . getValue ( ) . length <= 0 ;
15071517 if ( nocontent ) {
Original file line number Diff line number Diff line change 66 <div class =" ui-infobar container-fluid unselectable hidden-print" >
77 <small >
88 <span >
9- <span class =" ui-lastchangeuser" >&thinsp ; <i class =" ui-user-icon small" data-toggle =" tooltip" data-placement =" right" ></i ></span >
9+ <span class =" ui-lastchangeuser" style = " display : none ; " >&thinsp ; <i class =" ui-user-icon small" data-toggle =" tooltip" data-placement =" right" ></i ></span >
1010 <span class =" ui-no-lastchangeuser" >&thinsp ; <i class =" fa fa-clock-o" ></i ></span >
1111   ; <span class =" text-uppercase" >changed</span >
1212 <span class =" ui-lastchange text-uppercase" ></span >
You can’t perform that action at this time.
0 commit comments