mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
refactor: Remove MOBILE_APP logic
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user