Skip to content

Commit

Permalink
fix bootstrap references and fix welcome pop up is already shown logic
Browse files Browse the repository at this point in the history
bootstrap shown event handling changed.

Closes #9
  • Loading branch information
bleskes committed Sep 18, 2015
1 parent 29a96ef commit fdf26db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
20 changes: 9 additions & 11 deletions public/webpackShims/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ define([
}
if (typeof xhr.status == "number" &&
((xhr.status >= 400 && xhr.status < 600) ||
(xhr.status >= 200 && xhr.status < 300)
(xhr.status >= 200 && xhr.status < 300)
)) {
// we have someone on the other side. Add to history
history.addToHistory(es.getBaseUrl(), es_path, es_method, es_data);
Expand Down Expand Up @@ -354,17 +354,15 @@ define([
* Display the welcome popup if it has not been shown yet
*/
if (!localStorage.getItem("version_welcome_shown")) {
require(['welcome_popup'], function ($welcomePopup) {
$welcomePopup.on('shown', function () {
localStorage.setItem("version_welcome_shown", '@@MARVEL_REVISION');
});
$welcomePopup.one('hidden', function () {
loadSavedState();
setupAutosave();
});
$welcomePopup.modal('show');

let $welcomePopup = require('welcome_popup');
$welcomePopup.on('shown', function () {
localStorage.setItem("version_welcome_shown", '@@SENSE_REVISION');
});
$welcomePopup.one('hidden', function () {
loadSavedState();
setupAutosave();
});
$welcomePopup.modal('show');
}
else {
loadSavedState();
Expand Down
2 changes: 1 addition & 1 deletion public/webpackShims/help_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
define([
'sense_editor/editor',
'vendor/jquery',
'bootstrap'
'vendor/bootstrap'
], function (SenseEditor, $) {
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion public/webpackShims/misc_inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define([
'mappings',
'output',
'es',
'bootstrap'
'vendor/bootstrap'
], function ($, history, input, mappings, output, es) {
'use strict';

Expand Down
4 changes: 2 additions & 2 deletions public/webpackShims/welcome_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ define([
'sense_editor/editor',
'vendor/jquery',

'bootstrap'
'vendor/bootstrap'
], function (SenseEditor, $) {
'use strict';

Expand All @@ -39,7 +39,7 @@ define([
'GET index/type/1</div>'
].join('\n');

$welcomePopup.modal();
$welcomePopup.modal({show: false});
$welcomePopup.on('shown', function () {
$example = $(html)
.appendTo("#welcome_example_container");
Expand Down

0 comments on commit fdf26db

Please sign in to comment.