Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[goto] checking for possible problems (adding the snippet while one i…
…s already present)
  • Loading branch information
twitwi committed Apr 12, 2014
commit 6f1721cb6e5f729f10dfc1a68c8155fdcb9357b4
11 changes: 11 additions & 0 deletions extensions/goto/deck.goto.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ the deck container.
var maybeAddSnippet = function() {
var options = $.deck('getOptions');
if (options.snippets.goto) {
if ($(options.selectors.gotoForm).size() > 0 && options.alert.goto) {
alert("'options.snippets.goto' is true but a "+options.selectors.gotoForm+" has been found."
+"\nThis might cause interaction glitches."
+"\n"
+"\nSuggestion: remove your html snippet or pass the {snippets: {goto: false}} option."
);
}
$('<form/>').addClass('goto-form').attr('action', '.').attr('method', 'get')
.append($('<label/>').attr('for', 'goto-slide').text('Go to slide:'))
.append($('<input/>').attr('type', 'text').attr('id', 'goto-slide').attr('name', 'slidenum').attr('list', 'goto-datalist'))
Expand Down Expand Up @@ -152,6 +159,10 @@ the deck container.
goto: true
},

alert: {
goto: true
},

keys: {
goto: 71 // g
},
Expand Down