Fix bug.
This commit is contained in:
parent
92475fa0ed
commit
1c587dffe4
|
@ -159,7 +159,7 @@
|
||||||
<label class="control-label muted"><%= t(:url) %></label>
|
<label class="control-label muted"><%= t(:url) %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :url_translations do |f| %>
|
<%= 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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -244,6 +244,14 @@
|
||||||
filter.destroy();
|
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>
|
</script>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue