24 lines
684 B
JavaScript
24 lines
684 B
JavaScript
var FormPnw = function(w) {
|
|
this.window = w;
|
|
}
|
|
|
|
FormPnw.prototype.init = function() {
|
|
var doc = this.window.document;
|
|
|
|
doc.addEventListener('mousemove', function() {
|
|
var forms = doc.querySelectorAll('form[data-form-bot]');
|
|
|
|
for (var i = 0, len = forms.length; i < len; i++) {
|
|
var form = forms[i];
|
|
var action = form.getAttribute('action');
|
|
action = action.replace(Routing.generate('form_without_javascript') + '?page=', '');
|
|
action = decodeURIComponent(action);
|
|
|
|
form.setAttribute('action', action);
|
|
form.removeAttribute('data-form-bot');
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = FormPnw
|