Skip to content

Commit

Permalink
Ticket #139 - Needed to remove 1 int from -9999999px to -999999px for…
Browse files Browse the repository at this point in the history
…, you know

who (Firefox). At -9999999px, Firefox converts the pixel value to -1e+7px
meaning it wouldn't be testable.
  • Loading branch information
OscarGodson committed May 20, 2013
1 parent 8c71348 commit 921ef7b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions epiceditor/js/epiceditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
self.iframe.body.style.height = this.element.offsetHeight + 'px';

// Should actually check what mode it's in!
self.previewerIframe.style.left = '-9999999px';
self.previewerIframe.style.left = '-999999px';

// FIXME figure out why it needs +2 px
if (_isIE() > -1) {
Expand Down Expand Up @@ -1157,7 +1157,7 @@

// Hide the editor and display the previewer
if (!self.is('fullscreen')) {
self.editorIframe.style.left = '-9999999px';
self.editorIframe.style.left = '-999999px';
self.previewerIframe.style.left = '';
self._eeState.preview = true;
self._eeState.edit = false;
Expand Down Expand Up @@ -1198,7 +1198,7 @@
self._eeState.preview = false;
self._eeState.edit = true;
self.editorIframe.style.left = '';
self.previewerIframe.style.left = '-9999999px';
self.previewerIframe.style.left = '-999999px';
self.editorIframe.focus();
self.emit('edit');
return this;
Expand Down
2 changes: 1 addition & 1 deletion epiceditor/js/epiceditor.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
self.iframe.body.style.height = this.element.offsetHeight + 'px';

// Should actually check what mode it's in!
self.previewerIframe.style.left = '-9999999px';
self.previewerIframe.style.left = '-999999px';

// FIXME figure out why it needs +2 px
if (_isIE() > -1) {
Expand Down Expand Up @@ -1157,7 +1157,7 @@

// Hide the editor and display the previewer
if (!self.is('fullscreen')) {
self.editorIframe.style.left = '-9999999px';
self.editorIframe.style.left = '-999999px';
self.previewerIframe.style.left = '';
self._eeState.preview = true;
self._eeState.edit = false;
Expand Down Expand Up @@ -1198,7 +1198,7 @@
self._eeState.preview = false;
self._eeState.edit = true;
self.editorIframe.style.left = '';
self.previewerIframe.style.left = '-9999999px';
self.previewerIframe.style.left = '-999999px';
self.editorIframe.focus();
self.emit('edit');
return this;
Expand Down
2 changes: 1 addition & 1 deletion test/test.edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('.edit()', function () {
it('should make the editor visible when switching from preview back to edit', function () {
editor.preview();
editor.edit();
expect(editor.getElement('previewerIframe').style.left).to.be('-9999999px');
expect(editor.getElement('previewerIframe').style.left).to.be('-999999px');
expect(editor.getElement('editorIframe').style.left).to.be('');
});
});
Expand Down
6 changes: 3 additions & 3 deletions test/test.load.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ describe(".load([callback])", function () {
});

it('should initially load in editor mode', function () {
expect(editor.getElement('previewerIframe').style.left).to.be('-9999999px');
expect(editor.getElement('previewerIframe').style.left).to.be('-999999px');
expect(editor.getElement('editorIframe').style.left).to.be('');
});

it('should open preview mode if preview mode was the last mode it was on before unloading', function () {
editor.preview();
expect(editor.getElement('editorIframe').style.left).to.be('-9999999px');
expect(editor.getElement('editorIframe').style.left).to.be('-999999px');
expect(editor.getElement('previewerIframe').style.left).to.be('');
editor.unload();
editor.load();
expect(editor.getElement('editorIframe').style.left).to.be('-9999999px');
expect(editor.getElement('editorIframe').style.left).to.be('-999999px');
expect(editor.getElement('previewerIframe').style.left).to.be('');
});
});
6 changes: 3 additions & 3 deletions test/test.preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ describe('.preview()', function () {
});

it('should not initially be in previewer mode when loaded', function () {
expect(editor.getElement('previewerIframe').style.left).to.be('-9999999px');
expect(editor.getElement('previewerIframe').style.left).to.be('-999999px');
});

it('should display the previewer when the preview method is called', function () {
editor.preview();
expect(editor.getElement('previewerIframe').style.left).to.be('');
expect(editor.getElement('editorIframe').style.left).to.be('-9999999px');
expect(editor.getElement('editorIframe').style.left).to.be('-999999px');
});

it('should fire the preview event when the preview method is called', function () {
Expand All @@ -48,7 +48,7 @@ describe('.preview()', function () {
it('should hide the previewer if switched from preview back to edit', function () {
editor.preview();
editor.edit();
expect(editor.getElement('previewerIframe').style.left).to.be('-9999999px');
expect(editor.getElement('previewerIframe').style.left).to.be('-999999px');
expect(editor.getElement('editorIframe').style.left).to.be('');
});

Expand Down

0 comments on commit 921ef7b

Please sign in to comment.