set the correct href for external urls (#8823)
This commit is contained in:
parent
fedd9a57a5
commit
7089380db2
|
@ -67,9 +67,7 @@
|
||||||
<script type="text/x-tmpl" id="momo-default-footer-tmpl">
|
<script type="text/x-tmpl" id="momo-default-footer-tmpl">
|
||||||
<div class="col-xs-6 navbar-btn text-left">
|
<div class="col-xs-6 navbar-btn text-left">
|
||||||
<a href="https://dev.entrouvert.org/projects/momo/"
|
<a href="https://dev.entrouvert.org/projects/momo/"
|
||||||
class="btn btn-success pull-left momo-repo"
|
class="btn btn-success pull-left momo-repo" target="_system">Momo repository</a>
|
||||||
target="_system"
|
|
||||||
onclick="javascript:app.utils.onExternalLinkClick()">Momo repository</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 navbar-btn text-right">
|
<div class="col-xs-6 navbar-btn text-right">
|
||||||
<a href="mailto:{%= o.meta.contact %}"
|
<a href="mailto:{%= o.meta.contact %}"
|
||||||
|
@ -178,7 +176,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/x-tmpl" id="momo-list-item-tmpl">
|
<script type="text/x-tmpl" id="momo-list-item-tmpl">
|
||||||
<a href="#{%= o.id %}" class="{% if(!o.header){ %} list-group-item {% } %} clearfix {%= o.external ? 'offline-disable' : '' %}">
|
<a href="{% if(!o.external) { %}#{%= o.id %}{% } else { %}{%= o.url %}{% } %}" class="{% if(!o.header){ %} list-group-item {% } %} clearfix" target="_system">
|
||||||
{% if(o.header){ %}
|
{% if(o.header){ %}
|
||||||
<span class="pull-left">
|
<span class="pull-left">
|
||||||
{% if(o.icon){ %}
|
{% if(o.icon){ %}
|
||||||
|
@ -224,8 +222,8 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/x-tmpl" id="momo-icon-item-tmpl">
|
<script type="text/x-tmpl" id="momo-icon-item-tmpl">
|
||||||
<div class="col-xs-{%= o.colxs %} col-sm-{%= o.colsm %} col-md-{%= o.colmd %} col-lg-{%= o.collg %}">
|
<div class="col-xs-{%= o.colxs %} col-sm-{%= o.colsm %} col-md-{%= o.colmd %} col-lg-{%= o.collg %}">
|
||||||
<a href="#{%= o.id %}" class="btn btn-block text-center {%= o.className || 'btn-default' %} {%= o.external ? 'offline-disable' : '' %}">
|
<a href="{% if(!o.external) { %}#{%= o.id %}{% } else { %}{%= o.url %}{% } %}" class="btn btn-block text-center {%= o.className || 'btn-default' %}" target="_system">
|
||||||
{% if(o.external){ %}
|
{% if(o.external){ %}
|
||||||
<i class="fa fa-external-link top-right"></i>
|
<i class="fa fa-external-link top-right"></i>
|
||||||
{% } %}
|
{% } %}
|
||||||
|
|
|
@ -1445,15 +1445,6 @@ var app = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onExternalLinkClick: function(e){
|
|
||||||
e = e || window.event;
|
|
||||||
var targ = e.target || e.srcElement;
|
|
||||||
if (targ.nodeType === 3){ targ = targ.parentNode; }
|
|
||||||
var url = targ.getAttribute("href");
|
|
||||||
app.utils.openExternalURL(url);
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
openExternalURL: function(url){
|
openExternalURL: function(url){
|
||||||
window.replaceHash(app.parentPage);
|
window.replaceHash(app.parentPage);
|
||||||
if(navigator.app){ // Android
|
if(navigator.app){ // Android
|
||||||
|
|
Reference in New Issue