Revert "Don't load images twice"

This is beyond the scope of this branch, I would leave this in, but there is a lot of strange code including commented code in this file, so I'm leaving it out. It would be a better idea to fix the whole file in another branch (or Tim might be fixing this file with the media fixes)
This commit is contained in:
Daniel 2019-10-29 22:54:14 +00:00 committed by Raoul Snyman
parent eda847a8db
commit 61cf097d45
5 changed files with 10 additions and 44 deletions

View File

@ -377,7 +377,9 @@ var Display = {
* Reinitialise Reveal * Reinitialise Reveal
*/ */
reinit: function () { reinit: function () {
Reveal.reinitialize(); Reveal.sync();
// Python expects to be on first page after reinit
Reveal.slide(0);
}, },
/** /**
* Set the transition type * Set the transition type
@ -662,7 +664,6 @@ var Display = {
Display.addTextSlide(slide.verse, slide.text, slide.footer, false); Display.addTextSlide(slide.verse, slide.text, slide.footer, false);
}); });
Display.reinit(); Display.reinit();
Display.goToSlide(0);
}, },
/** /**
* Create the <section> that will contain text slides (vertical slides in react) * Create the <section> that will contain text slides (vertical slides in react)

View File

@ -441,14 +441,6 @@
} }
/**
* Restarts up the presentation if the client is capable.
*/
function reinitialize() {
initialized = false;
initialize(config);
}
/** /**
* Inspect the client to see what it's capable of, this * Inspect the client to see what it's capable of, this
* should only happens once per runtime. * should only happens once per runtime.
@ -5814,7 +5806,6 @@
VERSION: VERSION, VERSION: VERSION,
initialize: initialize, initialize: initialize,
reinitialize: reinitialize,
configure: configure, configure: configure,
sync: sync, sync: sync,

View File

@ -201,11 +201,10 @@ class DisplayWindow(QtWidgets.QWidget):
js_is_display = str(self.is_display).lower() js_is_display = str(self.is_display).lower()
self.run_javascript('Display.init({do_transitions});'.format(do_transitions=js_is_display)) self.run_javascript('Display.init({do_transitions});'.format(do_transitions=js_is_display))
self._is_initialised = True self._is_initialised = True
if self._can_show_startup_screen:
self.set_startup_screen()
# Make sure the scale is set if it was attempted set before init
if self.scale != 1: if self.scale != 1:
self.set_scale(self.scale) self.set_scale(self.scale)
if self._can_show_startup_screen:
self.set_startup_screen()
def run_javascript(self, script, is_sync=False): def run_javascript(self, script, is_sync=False):
""" """

View File

@ -1,25 +0,0 @@
--- reveal.js.orig 2018-08-01 10:37:51.000000000 +0200
+++ reveal.js 2019-02-11 21:25:39.396198927 +0100
@@ -383,6 +383,14 @@
}
/**
+ * Restarts up the presentation if the client is capable.
+ */
+ function reinitialize() {
+ initialized = false;
+ initialize(config);
+ }
+
+ /**
* Inspect the client to see what it's capable of, this
* should only happens once per runtime.
*/
@@ -5372,6 +5380,7 @@
VERSION: VERSION,
initialize: initialize,
+ reinitialize: reinitialize,
configure: configure,
sync: sync,

View File

@ -113,10 +113,12 @@ describe("The Display object", function () {
expect(Display.reinit).toBeDefined(); expect(Display.reinit).toBeDefined();
}); });
it("should re-initialise Reveal when reinit is called", function () { it("should sync Reveal and set to first slide when reinit is called", function () {
spyOn(Reveal, "reinitialize"); spyOn(Reveal, "sync");
spyOn(Reveal, "slide");
Display.reinit(); Display.reinit();
expect(Reveal.reinitialize).toHaveBeenCalled(); expect(Reveal.sync).toHaveBeenCalled();
expect(Reveal.slide).toHaveBeenCalledWith(0);
}); });
it("should have a setTransition() method", function () { it("should have a setTransition() method", function () {
@ -562,7 +564,6 @@ describe("Display.setTextSlides", function () {
]; ];
spyOn(Display, "clearSlides"); spyOn(Display, "clearSlides");
spyOn(Display, "reinit"); spyOn(Display, "reinit");
spyOn(Reveal, "slide");
Display.setTextSlides(slides); Display.setTextSlides(slides);
@ -571,7 +572,6 @@ describe("Display.setTextSlides", function () {
expect(Display._slides["v2"]).toEqual(1); expect(Display._slides["v2"]).toEqual(1);
expect($(".slides > section > section").length).toEqual(2); expect($(".slides > section > section").length).toEqual(2);
expect(Display.reinit).toHaveBeenCalledTimes(1); expect(Display.reinit).toHaveBeenCalledTimes(1);
expect(Reveal.slide).toHaveBeenCalledWith(0, 0);
}); });
it("should correctly set outline width", function () { it("should correctly set outline width", function () {