From 595e824b84e408cbeb809e88b76b6b32123c27be Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 11 Oct 2016 09:39:57 +0000
Subject: [PATCH] reload content after saving so we re-highlight correctly

---
 contrib/mobile/iOS/Onelab/AboutViewController.mm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/contrib/mobile/iOS/Onelab/AboutViewController.mm b/contrib/mobile/iOS/Onelab/AboutViewController.mm
index 5d43bf2c98..9bb5dd442e 100644
--- a/contrib/mobile/iOS/Onelab/AboutViewController.mm
+++ b/contrib/mobile/iOS/Onelab/AboutViewController.mm
@@ -35,11 +35,16 @@
   // Do any additional setup after loading the view.
   self.aboutView.delegate = self;
   self.aboutView.dataDetectorTypes = UIDataDetectorTypeNone;
+  [self loadContent];
+}
+
+-(void)loadContent
+{
   UIColor *tintColor = self.view.tintColor;
   CGFloat red, green, blue, alpha;
   [tintColor getRed: &red green: &green blue: &blue alpha: &alpha];
   int r = (int)(red*255), g = (int)(green*255), b = (int)(blue*255);
-  
+
   NSString *css = [NSString stringWithFormat:@"body { background-color: #FFFFFF; color: #252525; margin: 35px 10px 35px 10px; padding: 0; font-family: helvetica-neue,sans-serif; font-size: 1em; }  b { font-weight: normal; color: rgb(%d,%d,%d); } a { color: rgb(%d,%d,%d); }", r, g, b, r, g, b];
 
   if([self.fileToEdit isEqual:@"About"]){
@@ -73,9 +78,9 @@
     UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(saveFile)];
     [self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects: save, nil]];
   }
-
 }
 
+
 -(void)saveFile
 {
   NSString *text = [self.aboutView stringByEvaluatingJavaScriptFromString:
@@ -84,6 +89,7 @@
   NSError *error;
   [text writeToFile:self.fileToEdit atomically:YES
            encoding:NSUTF8StringEncoding error:&error];
+  [self loadContent];
 }
 
 - (void)didReceiveMemoryWarning
-- 
GitLab