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

This commit is contained in:
will
2019-05-16 15:30:09 -04:00
parent 8564c6e9f0
commit efcb9d229d
+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>
@@ -264,7 +264,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();
@@ -280,14 +280,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);
};