Skip to content

Commit

Permalink
refactor: Remove MOBILE_APP logic
Browse files Browse the repository at this point in the history
  • Loading branch information
crookedneighbor committed Apr 25, 2016
1 parent ad57ded commit b86348d
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions common/script/public/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* Markdown
* See http://www.heikura.me/#!/angularjs-markdown-directive
*/
(function(){
var md = function () {
Expand All @@ -26,7 +25,7 @@
};
}();

habitrpg.directive('markdown', ['$timeout','MOBILE_APP', function($timeout, MOBILE_APP) {
habitrpg.directive('markdown', ['$timeout', function($timeout) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
Expand All @@ -47,33 +46,14 @@

element.html(html);

if(MOBILE_APP) {
var elements = element.find("a");
_.forEach(elements, function(link){
if(link.href) {

link.onclick = function (e) {
scope.externalLink(this.href);

e.preventDefault();
e.stopPropagation();
};
}
});
}

if(removeWatch)
{
if (removeWatch) {
doRemoveWatch();
}
};

if(useTimeout)
{
if(useTimeout) {
$timeout(replaceMarkdown, timeoutTime);
}
else
{
} else {
replaceMarkdown();
}
});
Expand Down

0 comments on commit b86348d

Please sign in to comment.