@@ -53,7 +53,7 @@ function Dialog() {
5353 self . _cache [ dialog . _id ] = helpers . compileDialogParams ( dialog ) ;
5454 }
5555 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 ] ) ) ;
5757 } else {
5858 self . buildDialogItem ( self . _cache [ dialog . _id ] ) ;
5959 }
@@ -94,7 +94,7 @@ Dialog.prototype.init = function () {
9494 } ) ;
9595} ;
9696
97- Dialog . prototype . loadDialogs = function ( f , ) {
97+ Dialog . prototype . loadDialogs = function ( f , ) {
9898 var self = this ,
9999 filter = f ? f : {
100100 limit : self . limit ,
@@ -158,11 +158,11 @@ Dialog.prototype.renderDialog = function (dialog, setAsFirst) {
158158 var nameIcon = dialog . name . match ( / , .* ?./ ) ;
159159 nameIcon = dialog . name [ 0 ] + ( nameIcon !== null ? nameIcon [ 0 ] [ 2 ] : '' ) ;
160160
161- var template = helpers . fillTemplate ( 'tpl_userConversations' , { dialog : dialog , name : nameIcon } ) ;
161+ var template = helpers . fillTemplate ( 'tpl_userConversations' , { dialog : dialog , name : nameIcon } ) ;
162162 elem = helpers . toHtml ( template ) [ 0 ] ;
163163
164164
165- if ( self . dialogsListContainer . firstElementChild ) {
165+ if ( self . dialogsListContainer . firstElementChild ) {
166166 console . log ( self . dialogsListContainer . firstElementChild . id ) ;
167167 }
168168
@@ -414,7 +414,7 @@ Dialog.prototype.beforeCreateDialog = function () {
414414
415415 if ( type !== 3 ) {
416416 this . params . name = name ;
417- } else {
417+ } else {
418418 this . createDialog ( ) ;
419419 return false ;
420420 }
@@ -461,7 +461,7 @@ Dialog.prototype.createDialog = function () {
461461 params = this . params ;
462462
463463 if ( type !== 3 && name ) {
464- params . name = this . params . name = name ;
464+ params . name = this . params . name = name ;
465465 }
466466
467467 if ( ! app . checkInternetConnection ( ) ) {
@@ -479,7 +479,7 @@ Dialog.prototype.createDialog = function () {
479479 id = createdDialog . _id ,
480480 occupants = createdDialog . occupants_ids ,
481481 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 + '"' ,
483483 systemMessage = {
484484 extension : {
485485 notification_type : 1 ,
@@ -542,7 +542,7 @@ Dialog.prototype.getDialogById = function (id) {
542542 if ( ! app . checkInternetConnection ( ) ) {
543543 return false ;
544544 }
545- QB . chat . dialog . list ( { "_id" : id } , function ( err , res ) {
545+ QB . chat . dialog . list ( { "_id" : id } , function ( err , res ) {
546546 if ( err ) {
547547 console . error ( err ) ;
548548 reject ( err ) ;
@@ -644,13 +644,13 @@ Dialog.prototype.updateDialog = function (updates) {
644644 updatedMsg . extension . dialog_name = updates . title ;
645645 updatedMsg . body = app . user . name + ' changed the conversation name to "' + updates . title + '".' ;
646646 }
647- } else if ( updates . delete ) {
647+ } else if ( updates . delete ) {
648648
649649 toUpdateParams . pull_all = {
650650 occupants_ids : [ app . user . id ]
651651 } ;
652652
653- } else if ( updates . userList ) {
653+ } else if ( updates . userList ) {
654654 newUsers = updates . userList . filter ( function ( occupantId ) {
655655 return dialog . users . indexOf ( occupantId ) === - 1 ;
656656 } ) ;
@@ -789,10 +789,10 @@ Dialog.prototype.quitFromTheDialog = async function (dialogId) {
789789 delete self . _cache [ dialogId ] ;
790790 delete dialogModule . selectedDialogIds [ dialogId ] ;
791791 var dialogElem = document . getElementById ( dialogId ) ;
792- if ( dialogElem !== null ) {
792+ if ( dialogElem !== null ) {
793793 dialogElem . parentNode . removeChild ( dialogElem ) ;
794794 }
795- if ( dialogId === self . dialogId ) {
795+ if ( dialogId === self . dialogId ) {
796796 self . dialogId = null ;
797797 }
798798 }
@@ -839,10 +839,10 @@ Dialog.prototype.initGettingDialogs = function (userListConteiner, userListFilte
839839 } ) ;
840840
841841 self . userListConteiner &&
842- self . userListConteiner . addEventListener ( 'scroll' , this . scrollHandler ) ;
842+ self . userListConteiner . addEventListener ( 'scroll' , this . scrollHandler ) ;
843843
844844 self . userListFilter &&
845- self . userListFilter . addEventListener ( 'input' , self . filter ) ;
845+ self . userListFilter . addEventListener ( 'input' , self . filter ) ;
846846
847847 return this . getDialogs ( params ) ;
848848} ;
@@ -853,13 +853,13 @@ Dialog.prototype.buildDialogItem = function (user) {
853853
854854 if ( user . selected !== undefined ) {
855855 userItem . selected = user . selected ;
856- user . event = { click : false } ;
856+ user . event = { click : false } ;
857857 }
858858
859- if ( user . isLastMessage === undefined ) user . isLastMessage = true ;
859+ if ( user . isLastMessage === undefined ) user . isLastMessage = true ;
860860 userItem . isLastMessage = user . isLastMessage ;
861861
862- var userTpl = helpers . fillTemplate ( 'tpl_dialogItem' , { user : userItem } ) ,
862+ var userTpl = helpers . fillTemplate ( 'tpl_dialogItem' , { user : userItem } ) ,
863863 elem = helpers . toHtml ( userTpl ) [ 0 ] ;
864864
865865 elem . addEventListener ( 'click' , function ( ) {
@@ -883,7 +883,7 @@ Dialog.prototype.buildDialogItem = function (user) {
883883 self . selectedDialogIds . push ( elem . id ) ;
884884 }
885885
886- if ( document . querySelector ( '#selectedDialogIds' ) ) {
886+ if ( document . querySelector ( '#selectedDialogIds' ) ) {
887887 document . querySelector ( '#selectedDialogIds' ) . innerHTML = self . selectedDialogIds . length === 1 ?
888888 self . selectedDialogIds . length + ' chat selected' :
889889 self . selectedDialogIds . length + ' chats selected' ;
@@ -909,11 +909,11 @@ Dialog.prototype.setListeners = function () {
909909
910910 helpers . _ ( document ) . on ( "input" , ".dialog_name" , function ( _event , _element ) {
911911 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 ) {
914914 _element . nextElementSibling . classList . remove ( 'filled' ) ;
915915 document . querySelector ( '.j-create_dialog_btn' ) . removeAttribute ( 'disabled' ) ;
916- } else {
916+ } else {
917917 _element . nextElementSibling . classList . add ( 'filled' ) ;
918918 document . querySelector ( '.j-create_dialog_btn' ) . setAttribute ( 'disabled' , true ) ;
919919 }
0 commit comments