@@ -604,6 +604,22 @@ UserPageVw = pageVw.extend({
604604 }
605605 }
606606 } ,
607+
608+ setFollowingPlaceholder : function ( totalLength , currentLength ) {
609+ if ( totalLength > currentLength ) {
610+ this . $ ( '#inputFollowing' ) . attr ( 'placeholder' , window . polyglot . t ( 'SearchForFollowingPlaceholderMore' ) ) ;
611+ } else {
612+ this . $ ( '#inputFollowing' ) . attr ( 'placeholder' , window . polyglot . t ( 'SearchForFollowingPlaceholder' ) ) ;
613+ }
614+ } ,
615+
616+ setFollowersPlaceholder : function ( totalLength , currentLength ) {
617+ if ( totalLength > currentLength ) {
618+ this . $ ( '#inputFollowers' ) . attr ( 'placeholder' , window . polyglot . t ( 'SearchForFollowersPlaceholderMore' ) ) ;
619+ } else {
620+ this . $ ( '#inputFollowers' ) . attr ( 'placeholder' , window . polyglot . t ( 'SearchForFollowersPlaceholder' ) ) ;
621+ }
622+ } ,
607623
608624 categoryChanged : function ( ) {
609625 this . renderItems ( this . listings . get ( 'listings' ) ) ;
@@ -689,6 +705,8 @@ UserPageVw = pageVw.extend({
689705 return followingObject . guid ;
690706 } ) ;
691707 self . renderFollowing ( followingArray ) ;
708+ self . setFollowingPlaceholder ( followingArray . length , self . ownFollowing . length ) ;
709+
692710 //call followers 2nd so list of following is available
693711 self . fetchFollowers ( ) ;
694712 } else {
@@ -703,8 +721,11 @@ UserPageVw = pageVw.extend({
703721 return followingObject . guid ;
704722 } ) ;
705723 self . renderFollowing ( followingArray ) ;
724+ self . setFollowingPlaceholder ( followingArray . length , self . ownFollowing . length ) ;
725+
706726 //call followers 2nd so list of following is available
707727 self . fetchFollowers ( ) ;
728+
708729 //mark whether page is following you
709730 if ( self . options . ownPage === false && Boolean ( __ . findWhere ( followingArray , { guid : self . userID } ) ) ) {
710731 self . $ ( '.js-followsMe' ) . removeClass ( 'hide' ) ;
@@ -713,7 +734,6 @@ UserPageVw = pageVw.extend({
713734 if ( self . options . ownPage === false ) {
714735 self . toggleFollowButtons ( Boolean ( __ . findWhere ( ownFollowingData . following , { guid : self . pageID } ) ) ) ;
715736 }
716-
717737 } ) . fail ( function ( jqXHR , status , errorThrown ) {
718738 if ( self . isRemoved ( ) ) return ;
719739 console . log ( jqXHR ) ;
@@ -770,6 +790,7 @@ UserPageVw = pageVw.extend({
770790 if ( followerArray . length || this . followerFetchTotal == 0 ) {
771791 //always render the first time so the no followers message is shown for no followers
772792 this . renderFollowers ( followerArray , this . followerFetchTotal ) ;
793+ this . setFollowersPlaceholder ( this . followerFetchTotal , this . followerFetchStart )
773794 }
774795 } ,
775796 error : function ( ) {
@@ -909,7 +930,7 @@ UserPageVw = pageVw.extend({
909930 } ) ;
910931 } ,
911932
912- renderFollowing : function ( model ) {
933+ renderFollowing : function ( model ) {
913934 model = model || [ ] ;
914935 this . followingList = new personListView ( {
915936 model : model ,
@@ -933,11 +954,13 @@ UserPageVw = pageVw.extend({
933954 } ) ;
934955 }
935956
936- this . listenTo ( this . followerList , 'usersAdded' , ( ) => {
957+ this . listenTo ( this . followingList , 'usersAdded' , ( ) => {
937958 var searchTerms = this . $ ( '#inputFollowing' ) . val ( ) ;
938959 if ( this . followingSearch ) {
939960 this . followingSearch . reIndex ( ) ;
940961 searchTerms && this . followingSearch . search ( searchTerms ) ;
962+
963+ this . setFollowingPlaceholder ( model . length , this . followingSearch . size ( ) ) ;
941964 }
942965 } ) ;
943966 } ,
0 commit comments