Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presenter view: give the spawned slides window the ability to move our location #169

Merged
merged 1 commit into from Mar 6, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/js/presenter.js
Expand Up @@ -3,6 +3,10 @@ var w = null;

$(function(){
w = window.open('/' + window.location.search);
// Give the slide window a handle to the presenter view window.
// This will let either window be made fullscreen and
// still process slide advance/rewinds correctly.
w.presenterView = window;
// side menu accordian crap
$("#preso").bind("showoff:loaded", function (event) {
$(".menu > ul ul").hide()
Expand Down
18 changes: 17 additions & 1 deletion public/js/showoff.js
Expand Up @@ -215,7 +215,23 @@ function showSlide(back_step) {
var currentContent = $(currentSlide).find(".content")
currentContent.trigger("showoff:show");

return getCurrentNotes()
var ret = getCurrentNotes()
// If we have a presenterView attribute, that means this window was
// opened by a presenter view, and we should poke it to make
// it be on the same slide as us and show the correct notes.
//
// TODO: we do this in such a hacky way to avoid ever
// assigning to the presenterView variable here. If we do
// that, we can clobber the value sent in by the parent
// presentation view and break the feature. Is there a better
// way to do this?
if ('presenterView' in window) {
var pv = window.presenterView;
pv.slidenum = slidenum;
pv.showSlide(true);
pv.postSlide();
}
return ret;
}

function getSlideProgress()
Expand Down