Skip to content

Commit

Permalink
Updated js/layout/forms.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Fiedorowicz committed Sep 5, 2016
1 parent cc987ff commit 3bbf38f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Installation
Changelog
---------

## 1.1.0.6-alpha, September 5, 2016

- Updated js/layout/forms.js

## 1.1.0.5-alpha, August 26, 2016

- Bugfix
Expand Down
23 changes: 18 additions & 5 deletions web/js/layout/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,31 @@ $(window).ready(function() {
mata.form.trackFormChange();
mata.form.setFormGroups();

$('.back-btn', window.parent.document).on('click', function () {
return mata.form.checkFormChange();
$('.back-btn', window.parent.document).on('mousedown', function () {
if (mata.form.checkFormChange() == false) {

e.stopPropagation();
e.preventDefault();
return false;
}
});
$(window.parent.document).trigger('myCustomTrigger');
});

$(window.parent).on('popstate pushstate', function(e) {
return mata.form.checkFormChange();
if (mata.form.checkFormChange() == false) {
e.stopPropagation();
e.preventDefault();
return false;
}
});

$("#w0 a, #subnav-overlay a, .cd-3d-nav a", window.parent.document).on("click", function() {
return mata.form.checkFormChange();
$("#w0 a, #subnav-overlay a, .cd-3d-nav a", window.parent.document).on("mousedown", function() {
if (mata.form.checkFormChange() == false) {
e.stopPropagation();
e.preventDefault();
return false;
}
});

mata.form.trackFormChange = function() {
Expand Down

0 comments on commit 3bbf38f

Please sign in to comment.