remove href from a tag to prevent backbone page reload and change some vars to const

This commit is contained in:
will
2019-06-17 14:43:13 -04:00
committed by Dannon Baker
parent 9e3791ca42
commit 0fec22d015
+5 -5
View File
@@ -25,7 +25,7 @@
<span id="item-url-text" style="display: none">
{{ item_url_parts[0] }}<span id="item-identifier">{{ item_url_parts[1] }}</span>
</span>
<a href="#" id="edit-identifier"><img :src="pencil_url"/></a>
<a href="javascript:void(0)" id="edit-identifier"><img :src="pencil_url" alt="Edit Share Url"/></a>
</blockquote>
<div v-if="item.published">
<p>
@@ -263,7 +263,7 @@ export default {
.catch(error => (this.err_msg = error.response.data.err_msg));
},
createSlugHandler: function() {
var on_start = function(text_elt) {
const on_start = function(text_elt) {
// Replace URL with URL text.
$("#item-url").hide();
$("#item-url-text").show();
@@ -279,14 +279,14 @@ export default {
);
});
};
var on_finish = function(text_elt) {
const on_finish = function(text_elt) {
// Replace URL text with URL.
$("#item-url-text").hide();
$("#item-url").show();
// Set URL to new value.
var new_url = $("#item-url-text").text();
var item_url_obj = $("#item-url");
const new_url = $("#item-url-text").text();
const item_url_obj = $("#item-url");
item_url_obj.attr("href", new_url);
item_url_obj.text(new_url);
};