@@ -53,7 +53,7 @@ function Dialog() {
53
53
self . _cache [ dialog . _id ] = helpers . compileDialogParams ( dialog ) ;
54
54
}
55
55
if ( args !== undefined && args . selected !== undefined ) {
56
- self . buildDialogItem ( Object . assign ( { selected : args . selected , isLastMessage :args . isLastMessage } , self . _cache [ dialog . _id ] ) ) ;
56
+ self . buildDialogItem ( Object . assign ( { selected : args . selected , isLastMessage : args . isLastMessage } , self . _cache [ dialog . _id ] ) ) ;
57
57
} else {
58
58
self . buildDialogItem ( self . _cache [ dialog . _id ] ) ;
59
59
}
@@ -94,7 +94,7 @@ Dialog.prototype.init = function () {
94
94
} ) ;
95
95
} ;
96
96
97
- Dialog . prototype . loadDialogs = function ( f , ) {
97
+ Dialog . prototype . loadDialogs = function ( f , ) {
98
98
var self = this ,
99
99
filter = f ? f : {
100
100
limit : self . limit ,
@@ -158,11 +158,11 @@ Dialog.prototype.renderDialog = function (dialog, setAsFirst) {
158
158
var nameIcon = dialog . name . match ( / , .* ?./ ) ;
159
159
nameIcon = dialog . name [ 0 ] + ( nameIcon !== null ? nameIcon [ 0 ] [ 2 ] : '' ) ;
160
160
161
- var template = helpers . fillTemplate ( 'tpl_userConversations' , { dialog : dialog , name : nameIcon } ) ;
161
+ var template = helpers . fillTemplate ( 'tpl_userConversations' , { dialog : dialog , name : nameIcon } ) ;
162
162
elem = helpers . toHtml ( template ) [ 0 ] ;
163
163
164
164
165
- if ( self . dialogsListContainer . firstElementChild ) {
165
+ if ( self . dialogsListContainer . firstElementChild ) {
166
166
console . log ( self . dialogsListContainer . firstElementChild . id ) ;
167
167
}
168
168
@@ -414,7 +414,7 @@ Dialog.prototype.beforeCreateDialog = function () {
414
414
415
415
if ( type !== 3 ) {
416
416
this . params . name = name ;
417
- } else {
417
+ } else {
418
418
this . createDialog ( ) ;
419
419
return false ;
420
420
}
@@ -461,7 +461,7 @@ Dialog.prototype.createDialog = function () {
461
461
params = this . params ;
462
462
463
463
if ( type !== 3 && name ) {
464
- params . name = this . params . name = name ;
464
+ params . name = this . params . name = name ;
465
465
}
466
466
467
467
if ( ! app . checkInternetConnection ( ) ) {
@@ -479,7 +479,7 @@ Dialog.prototype.createDialog = function () {
479
479
id = createdDialog . _id ,
480
480
occupants = createdDialog . occupants_ids ,
481
481
typeChat = ( createdDialog . type === CONSTANTS . DIALOG_TYPES . GROUPCHAT ) ? ' the group' : '' ,
482
- message_body = ( app . user . name || app . user . login ) + ' created' + typeChat + ' chat "' + createdDialog . name + '"' ,
482
+ message_body = ( app . user . name || app . user . login ) + ' created' + typeChat + ' chat "' + createdDialog . name + '"' ,
483
483
systemMessage = {
484
484
extension : {
485
485
notification_type : 1 ,
@@ -542,7 +542,7 @@ Dialog.prototype.getDialogById = function (id) {
542
542
if ( ! app . checkInternetConnection ( ) ) {
543
543
return false ;
544
544
}
545
- QB . chat . dialog . list ( { "_id" : id } , function ( err , res ) {
545
+ QB . chat . dialog . list ( { "_id" : id } , function ( err , res ) {
546
546
if ( err ) {
547
547
console . error ( err ) ;
548
548
reject ( err ) ;
@@ -644,13 +644,13 @@ Dialog.prototype.updateDialog = function (updates) {
644
644
updatedMsg . extension . dialog_name = updates . title ;
645
645
updatedMsg . body = app . user . name + ' changed the conversation name to "' + updates . title + '".' ;
646
646
}
647
- } else if ( updates . delete ) {
647
+ } else if ( updates . delete ) {
648
648
649
649
toUpdateParams . pull_all = {
650
650
occupants_ids : [ app . user . id ]
651
651
} ;
652
652
653
- } else if ( updates . userList ) {
653
+ } else if ( updates . userList ) {
654
654
newUsers = updates . userList . filter ( function ( occupantId ) {
655
655
return dialog . users . indexOf ( occupantId ) === - 1 ;
656
656
} ) ;
@@ -789,10 +789,10 @@ Dialog.prototype.quitFromTheDialog = async function (dialogId) {
789
789
delete self . _cache [ dialogId ] ;
790
790
delete dialogModule . selectedDialogIds [ dialogId ] ;
791
791
var dialogElem = document . getElementById ( dialogId ) ;
792
- if ( dialogElem !== null ) {
792
+ if ( dialogElem !== null ) {
793
793
dialogElem . parentNode . removeChild ( dialogElem ) ;
794
794
}
795
- if ( dialogId === self . dialogId ) {
795
+ if ( dialogId === self . dialogId ) {
796
796
self . dialogId = null ;
797
797
}
798
798
}
@@ -839,10 +839,10 @@ Dialog.prototype.initGettingDialogs = function (userListConteiner, userListFilte
839
839
} ) ;
840
840
841
841
self . userListConteiner &&
842
- self . userListConteiner . addEventListener ( 'scroll' , this . scrollHandler ) ;
842
+ self . userListConteiner . addEventListener ( 'scroll' , this . scrollHandler ) ;
843
843
844
844
self . userListFilter &&
845
- self . userListFilter . addEventListener ( 'input' , self . filter ) ;
845
+ self . userListFilter . addEventListener ( 'input' , self . filter ) ;
846
846
847
847
return this . getDialogs ( params ) ;
848
848
} ;
@@ -853,13 +853,13 @@ Dialog.prototype.buildDialogItem = function (user) {
853
853
854
854
if ( user . selected !== undefined ) {
855
855
userItem . selected = user . selected ;
856
- user . event = { click : false } ;
856
+ user . event = { click : false } ;
857
857
}
858
858
859
- if ( user . isLastMessage === undefined ) user . isLastMessage = true ;
859
+ if ( user . isLastMessage === undefined ) user . isLastMessage = true ;
860
860
userItem . isLastMessage = user . isLastMessage ;
861
861
862
- var userTpl = helpers . fillTemplate ( 'tpl_dialogItem' , { user : userItem } ) ,
862
+ var userTpl = helpers . fillTemplate ( 'tpl_dialogItem' , { user : userItem } ) ,
863
863
elem = helpers . toHtml ( userTpl ) [ 0 ] ;
864
864
865
865
elem . addEventListener ( 'click' , function ( ) {
@@ -883,7 +883,7 @@ Dialog.prototype.buildDialogItem = function (user) {
883
883
self . selectedDialogIds . push ( elem . id ) ;
884
884
}
885
885
886
- if ( document . querySelector ( '#selectedDialogIds' ) ) {
886
+ if ( document . querySelector ( '#selectedDialogIds' ) ) {
887
887
document . querySelector ( '#selectedDialogIds' ) . innerHTML = self . selectedDialogIds . length === 1 ?
888
888
self . selectedDialogIds . length + ' chat selected' :
889
889
self . selectedDialogIds . length + ' chats selected' ;
@@ -909,11 +909,11 @@ Dialog.prototype.setListeners = function () {
909
909
910
910
helpers . _ ( document ) . on ( "input" , ".dialog_name" , function ( _event , _element ) {
911
911
var dialogName = _element . value . trim ( ) ;
912
- document . forms . create_dialog . dialog_name . isValid = 20 >= dialogName . length && dialogName . length >= 3 ;
913
- if ( document . forms . create_dialog . dialog_name . isNotValid ) {
912
+ document . forms . create_dialog . dialog_name . isValid = 20 >= dialogName . length && dialogName . length >= 3 ;
913
+ if ( document . forms . create_dialog . dialog_name . isValid ) {
914
914
_element . nextElementSibling . classList . remove ( 'filled' ) ;
915
915
document . querySelector ( '.j-create_dialog_btn' ) . removeAttribute ( 'disabled' ) ;
916
- } else {
916
+ } else {
917
917
_element . nextElementSibling . classList . add ( 'filled' ) ;
918
918
document . querySelector ( '.j-create_dialog_btn' ) . setAttribute ( 'disabled' , true ) ;
919
919
}
0 commit comments