From c622effe8044ae9dbb6508836cf7f879cf824f2f Mon Sep 17 00:00:00 2001 From: alexwl Date: Sun, 28 Oct 2018 19:41:41 +0300 Subject: Fix HTML page title --- javascript/app/routes/package.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'javascript/app/routes') diff --git a/javascript/app/routes/package.js b/javascript/app/routes/package.js index 92fea03..9d6772d 100644 --- a/javascript/app/routes/package.js +++ b/javascript/app/routes/package.js @@ -7,9 +7,6 @@ export default Ember.Route.extend({ return this.get('store').loadPackage(params.packageId) .catch((e) => {console.log(e);this.transitionTo("/package-not-found");}); }, - afterModel(model) { - document.title = model.id; - }, setupController(controller, model) { this._super(controller, model); const packageId = this.modelFor('package').id; @@ -17,7 +14,7 @@ export default Ember.Route.extend({ controller.set('createSearchUrlFunction',(query) => { return urls.identifierSearchUrl(packageId,query); }); - }, + }, actions : { openFile (filePath) { this.transitionTo('package.show.file',filePath); @@ -33,6 +30,10 @@ export default Ember.Route.extend({ this.set('controller.occName',occName); this.set('controller.bottomPanelVisible',true); this.set('controller.referencesUrl',urls.referencesUrl(packageId,externalId)+"?per_page=50"); + }, + didTransition() { + document.title = this.currentModel.id; + return true; } } }); -- cgit v1.2.3