@@ -70,6 +70,7 @@ module.exports = baseVw.extend({
7070 this . orderID = options . orderID ;
7171 this . status = options . status ;
7272 this . transactionType = options . transactionType ;
73+ this . unread = options . unread ;
7374 this . parentEl = options . parentEl ;
7475 this . countriesArray = options . countriesArray ;
7576 this . cCode = options . cCode ;
@@ -96,12 +97,12 @@ module.exports = baseVw.extend({
9697 this . model = new orderModel ( {
9798 cCode : this . cCode ,
9899 btAve : this . btAve ,
99- serverUrl : this . serverUrl ,
100- transactionType : this . transactionType ,
101- avatarURL : this . avatarURL ,
102- avatar_hash : this . userProfile . get ( 'avatar_hash' ) ,
103- orderID : this . orderID ,
104- userGuid : this . userModel . get ( 'guid' )
100+ // serverUrl: this.serverUrl,
101+ // transactionType: this.transactionType,
102+ // avatarURL: this.avatarURL,
103+ // avatar_hash: this.userProfile.get('avatar_hash'),
104+ // orderID: this.orderID,
105+ // userGuid: this.userModel.get('guid')
105106 } ) ;
106107 this . model . urlRoot = options . serverUrl + "get_order" ;
107108 this . listenTo ( this . model , 'change:priceSet' , this . render ) ;
@@ -145,7 +146,7 @@ module.exports = baseVw.extend({
145146 render : function ( ) {
146147 var self = this ;
147148 $ ( '.js-loadingModal' ) . addClass ( "hide" ) ;
148- this . model . set ( 'status' , this . status ) ;
149+ // this.model.set('status', this.status);
149150 //makde sure data is valid
150151 if ( this . model . get ( 'invalidData' ) ) {
151152 messageModal . show ( window . polyglot . t ( 'errorMessages.serverError' , self . model . get ( 'error' ) ) ) ;
@@ -155,7 +156,15 @@ module.exports = baseVw.extend({
155156 loadTemplate ( './js/templates/transactionModal.html' , function ( loadedTemplate ) {
156157 //hide the modal when it first loads
157158 self . parentEl . html ( self . $el ) ;
158- self . $el . html ( loadedTemplate ( self . model . toJSON ( ) ) ) ;
159+ self . $el . html ( loadedTemplate ( __ . extend ( { } , self . model . toJSON ( ) , {
160+ unread : self . unread ,
161+ serverUrl : self . serverUrl ,
162+ bitcoinValidationRegex : config . bitcoinValidationRegex ,
163+ transactionType : self . transactionType ,
164+ userGuid : self . userModel . get ( 'guid' ) ,
165+ status : self . status
166+ } )
167+ ) ) ;
159168 // add blur to container
160169 $ ( '#obContainer' ) . addClass ( 'blur' ) ;
161170 self . delegateEvents ( ) ; //reapply events if this is a second render
@@ -269,6 +278,10 @@ module.exports = baseVw.extend({
269278 this . $el . find ( '.js-tab' ) . removeClass ( 'active' ) ;
270279 this . $el . find ( '.js-' + state ) . removeClass ( 'hide' ) ;
271280 this . $el . find ( '.js-' + state + 'Tab' ) . addClass ( 'active' ) . removeClass ( 'hide' ) ;
281+
282+ if ( state == "discussion" ) {
283+ $ . post ( app . serverConfigs . getActive ( ) . getServerBaseUrl ( ) + '/mark_discussion_as_read' , { id : this . orderID } ) ;
284+ }
272285
273286 if ( state == "discussion" && this . discussionScroller ) {
274287 this . discussionScroller [ 0 ] . scrollTop = this . discussionScroller [ 0 ] . scrollHeight ;
0 commit comments