vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js in glebtv-ckeditor-4.6.0 vs vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js in glebtv-ckeditor-4.7.3

- old
+ new

@@ -9,12 +9,11 @@ */ 'use strict'; CKEDITOR.plugins.add( 'notification', { - lang: 'az,ca,cs,da,de,de-ch,en,eo,es,eu,fr,gl,id,it,ja,km,ko,ku,nb,nl,oc,pl,pt,pt-br,ru,sv,tr,ug,uk,zh,zh-cn', // %REMOVE_LINE_CORE% - requires: 'toolbar', + lang: 'en,ru', // %REMOVE_LINE_CORE% init: function( editor ) { editor._.notificationArea = new Area( editor ); // Overwrites default `editor.showNotification`. @@ -126,11 +125,11 @@ this.type = 'info'; } this.element = this._createElement(); - // Don't allow dragging on notification (#13184). + // Don't allow dragging on notification (http://dev.ckeditor.com/ticket/13184). editor.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement( this.element ); } /** * The editor instance. @@ -354,11 +353,11 @@ '<span class="cke_label">X</span>' + '</a>' ); notificationElement.append( notificationCloseElement ); notificationCloseElement.on( 'click', function() { - // Focus editor on close (#12865) + // Focus editor on close (http://dev.ckeditor.com/ticket/12865) notification.editor.focus(); notification.hide(); } ); @@ -611,12 +610,12 @@ _layout: function() { var area = this.element, editor = this.editor, contentsRect = editor.ui.contentsElement.getClientRect(), contentsPos = editor.ui.contentsElement.getDocumentPosition(), - top = editor.ui.space( 'top' ), - topRect = top.getClientRect(), + top, + topRect, areaRect = area.getClientRect(), notification, notificationWidth = this._notificationWidth, notificationMargin = this._notificationMargin, win = CKEDITOR.document.getWindow(), @@ -633,10 +632,17 @@ notificationMargin = this._notificationMargin = parseInt( notification.getComputedStyle( 'margin-left' ), 10 ) + parseInt( notification.getComputedStyle( 'margin-right' ), 10 ); } + // Check if toolbar exist and if so, then assign values to it (#491). + if ( editor.toolbar ) { + top = editor.ui.space( 'top' ); + topRect = top.getClientRect(); + } + + // --------------------------------------- Horizontal layout ---------------------------------------- // +---Viewport-------------------------------+ +---Viewport-------------------------------+ // | | | | // | +---Toolbar----------------------------+ | | +---Content----------------------------+ | @@ -649,10 +655,10 @@ // | | | | | | +------Notification------+ | | // | | | | | | | | // | | | | | | | | // | +--------------------------------------+ | | +--------------------------------------+ | // +------------------------------------------+ +------------------------------------------+ - if ( top.isVisible() && + if ( top && top.isVisible() && topRect.bottom > contentsRect.top && topRect.bottom < contentsRect.bottom - areaRect.height ) { setBelowToolbar(); // +---Viewport-------------------------------+