Fix bug.
This commit is contained in:
parent
92475fa0ed
commit
1c587dffe4
|
@ -159,7 +159,7 @@
|
|||
<label class="control-label muted"><%= t(:url) %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :url_translations do |f| %>
|
||||
<%= f.text_field locale, class: "input-block-level", placeholder: t(:url), value: (@link.url_translations[locale] rescue nil) %>
|
||||
<%= f.text_field locale, class: "input-block-level url_input", placeholder: t(:url), value: (@link.url_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -244,6 +244,14 @@
|
|||
filter.destroy();
|
||||
} );
|
||||
});
|
||||
$('.url_input').on('paste', function(e){
|
||||
var pastedData = e.originalEvent.clipboardData.getData('text');
|
||||
var _this = $(this);
|
||||
pastedData = pastedData.replace(new RegExp('^http(s|)://' + window.location.host), '');
|
||||
window.setTimeout(function(){
|
||||
_this.val(pastedData);
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
Loading…
Reference in New Issue