We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff5204b commit 2c603ffCopy full SHA for 2c603ff
src/actions/views/editor/_editor.php
@@ -47,7 +47,7 @@
47
endforeach;
48
?>
49
<li class="pull-right">
50
- <button class="btn btn-block btn-primary"><?= Yii::t('prototype', 'Save changes') ?></button>
+ <button type="submit" id="save-changes" class="btn btn-block btn-primary"><?= Yii::t('prototype', 'Save changes') ?></button>
51
</li>
52
</ul>
53
<div class="tab-content">
src/assets/web/editor/js/editor.js
@@ -32,8 +32,12 @@ $(function(){
32
localStorage.setItem(localStorageKey, newActiveHash);
33
});
34
35
+ $('#save-changes').on('click', function () {
36
+ window.onbeforeunload = null
37
+ });
38
+
39
// remember user to save stuff
- window.onbeforeunload = function() {
40
+ window.onbeforeunload = function (e) {
41
return true;
- };
42
+ }
43
0 commit comments