Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_texteditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--css/style.css23
-rw-r--r--js/editor.js26
2 files changed, 27 insertions, 22 deletions
diff --git a/css/style.css b/css/style.css
index 4807b70..09d744d 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1,10 +1,25 @@
-#editor{
- position: fixed;
+#editor {
+ position: relative;
display: block;
- top: 6.8em;
+ top: 0;
+ left: 0;
z-index: 20;
+ height: 100%;
+ width: 100%;
}
-#editor_save{
+
+#editor_container{
+ position: absolute;
+ display: block;
+ top: 0;
+ left: 0;
+ padding-top: 38px;
+ height: 100%;
+ width: 100%;
+ box-sizing: border-box;
+}
+
+#editor_save {
margin-left: 7px;
float: left;
}
diff --git a/js/editor.js b/js/editor.js
index 385b25d..35bda47 100644
--- a/js/editor.js
+++ b/js/editor.js
@@ -1,8 +1,3 @@
-function setEditorSize() {
- // Sets the size of the text editor window.
- fillWindow($('#editor'));
-}
-
function getFileExtension(file) {
var parts = file.split('.');
return parts[parts.length - 1];
@@ -193,7 +188,7 @@ function showFileEditor(dir, filename) {
// Delete any old editors
$('#editor').remove();
// Loads the file editor and display it.
- $('#content').append('<div id="editor"></div>');
+ $('#content').append('<div id="editor_container"><div id="editor"></div></div>');
var data = $.getJSON(
OC.filePath('files_texteditor', 'ajax', 'loadfile.php'),
{file: filename, dir: dir},
@@ -218,7 +213,6 @@ function showFileEditor(dir, filename) {
if ( ! result.data.writeable ) {
aceEditor.setReadOnly(true);
}
- setEditorSize();
if (result.data.mime && result.data.mime === 'text/html') {
setSyntaxMode('html');
} else {
@@ -262,9 +256,9 @@ function showFileEditor(dir, filename) {
// Fades out the editor.
function hideFileEditor() {
OC.Breadcrumb.pop();
- if ($('#editor').attr('data-edited') == 'true') {
+ if ($('#editor_container').attr('data-edited') == 'true') {
// Hide, not remove
- $('#editorcontrols,#editor').hide();
+ $('#editorcontrols,#editor_container').hide();
// Fade out editor
// Reset document title
document.title = $('body').attr('old_title');
@@ -275,7 +269,7 @@ function hideFileEditor() {
is_editor_shown = false;
} else {
// Fade out editor
- $('#editor, #editorcontrols').remove();
+ $('#editor_container, #editorcontrols').remove();
// Reset document title
document.title = $('body').attr('old_title');
$('.actions,#file_access_panel').show();
@@ -289,17 +283,13 @@ function reopenEditor() {
$('.actions,#file_action_panel').hide();
$('#content table').hide();
$('#controls .last').not('#breadcrumb_file').removeClass('last');
- $('#editor').show();
+ $('#editor_container').show();
$('#editorcontrols').show();
- OC.Breadcrumb.push($('#editor').attr('data-filename') + ' *', '#');
- document.title = $('#editor').attr('data-filename') + ' * - ownCloud';
+ OC.Breadcrumb.push($('#editor_container').attr('data-filename') + ' *', '#');
+ document.title = $('#editor_container').attr('data-filename') + ' * - ownCloud';
is_editor_shown = true;
}
-// resizes the editor window
-$(window).resize(function () {
- setEditorSize();
-});
var is_editor_shown = false;
$(document).ready(function () {
if (typeof FileActions !== 'undefined') {
@@ -348,7 +338,7 @@ $(document).ready(function () {
};
// Binds the file save and close editor events, and gotoline button
bindControlEvents();
- $('#editor').remove();
+ $('#editor_container').remove();
$('#notification').click(function () {
if ($('#notification').data('reopeneditor')) {
reopenEditor();