refactor: Remove MOBILE_APP logic

This commit is contained in:
Blade Barringer
2016-04-25 07:44:05 -05:00
parent ad57dedecb
commit b86348dd0e

View File

@@ -2,7 +2,6 @@
/** /**
* Markdown * Markdown
* See http://www.heikura.me/#!/angularjs-markdown-directive
*/ */
(function(){ (function(){
var md = function () { var md = function () {
@@ -26,7 +25,7 @@
}; };
}(); }();
habitrpg.directive('markdown', ['$timeout','MOBILE_APP', function($timeout, MOBILE_APP) { habitrpg.directive('markdown', ['$timeout', function($timeout) {
return { return {
restrict: 'E', restrict: 'E',
link: function(scope, element, attrs) { link: function(scope, element, attrs) {
@@ -47,33 +46,14 @@
element.html(html); element.html(html);
if(MOBILE_APP) { if (removeWatch) {
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)
{
doRemoveWatch(); doRemoveWatch();
} }
}; };
if(useTimeout) if(useTimeout) {
{
$timeout(replaceMarkdown, timeoutTime); $timeout(replaceMarkdown, timeoutTime);
} } else {
else
{
replaceMarkdown(); replaceMarkdown();
} }
}); });