From 24dcbcc7ba4c48bb86930fe166153d9af1eb8494 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 8 Mar 2018 18:34:25 +0100 Subject: [PATCH] [webpack.teacher.view] instant-edit now updates the 'category label' from 'gstore.get.filters.categories' if possible --- webpack/data/teacher.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webpack/data/teacher.js b/webpack/data/teacher.js index d9981fa..3ac306e 100644 --- a/webpack/data/teacher.js +++ b/webpack/data/teacher.js @@ -590,7 +590,16 @@ gstore.add('ie_handler', function(prof_i){ gstore.get.professors[prof_i].casLogin = cas; gstore.get.professors[prof_i].hoursToDo = hour; - /* (5.9.2) Remove edit mode */ + /* (5.9.2) Try to set the category label */ + var ci = gstore.get.filters.categories.map( (data, i) => { return ( data.code && data.code == cat ) ? i : ''; }).join(''); + + /* (5.9.3) Exit if not found */ + if( isNaN(ci) ) return gstore.add('edit_i', -1); + + /* (5.9.4) If found -> set category label */ + gstore.get.professors[prof_i].categorie = gstore.get.filters.categories[ci].name; + + /* (5.9.5) Remove edit mode */ gstore.add('edit_i', -1);