From a52ef204e72101cdbcc952b9e80d0e78e651b817 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 27 Sep 2012 06:12:03 -0400 Subject: [PATCH] minor changes --- client.js | 12 +++++++----- lib/client/editor.js | 5 ++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client.js b/client.js index a8064d75..e27840a9 100644 --- a/client.js +++ b/client.js @@ -717,12 +717,14 @@ CloudClient.Util = (function(){ return ( lCurrentFileClass.indexOf(lCurrentClass) >= 0 ); }; - this.getCurrentLink = function(pCurrentFile){ - var lCurrent = this.getCurrentFile(); - + this.getCurrentLink = function(pCurrentFile){ var lLink; - lLink = (pCurrentFile ? pCurrentFile : lCurrent) - .getElementsByTagName('a')[0]; + if(pCurrentFile) + lLink = this.getByTag('a', pCurrentFile)[0]; + else{ + var lCurrentFile = this.getCurrentFile(); + lLink = this.getByTag('a', lCurrentFile)[0]; + } if(!lLink) this.addCloudStatus({ diff --git a/lib/client/editor.js b/lib/client/editor.js index 70c470c7..b3db2675 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -114,9 +114,8 @@ var CloudCommander, CloudFunc, CodeMirror; var lA; /* getting link */ - lA = Util.getByTag('a', pCurrentFile); - - lA = lA[0].href; + lA = Util.getCurrentLink(pCurrentFile); + lA = lA.href; /* убираем адрес хоста*/ lA = '/' + lA.replace(document.location.href,'');