This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from ckeditor/t/142
Fix: Button tooltip should not look blurry on ldpi screens. Closes #142. Closes #133.
- Loading branch information
Showing
5 changed files
with
264 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/** | ||
* @module ui/tooltip/tooltipview | ||
*/ | ||
|
||
import View from '../view'; | ||
import Template from '../template'; | ||
|
||
/** | ||
* The tooltip view class. | ||
* | ||
* @extends module:ui/view~View | ||
*/ | ||
export default class TooltipView extends View { | ||
/** | ||
* @inheritDoc | ||
*/ | ||
constructor( locale ) { | ||
super( locale ); | ||
|
||
/** | ||
* The text of the tooltip visible to the user. | ||
* | ||
* @observable | ||
* @member {String} #text | ||
*/ | ||
this.set( 'text' ); | ||
|
||
/** | ||
* The position of the tooltip (south or north). | ||
* | ||
* +-----------+ | ||
* | north | | ||
* +-----------+ | ||
* V | ||
* [element] | ||
* | ||
* [element] | ||
* ^ | ||
* +-----------+ | ||
* | south | | ||
* +-----------+ | ||
* | ||
* @observable | ||
* @default 's' | ||
* @member {'s'|'n'} #position | ||
*/ | ||
this.set( 'position', 's' ); | ||
|
||
const bind = this.bindTemplate; | ||
|
||
this.template = new Template( { | ||
tag: 'span', | ||
attributes: { | ||
class: [ | ||
'ck-tooltip', | ||
bind.to( 'position', position => 'ck-tooltip_' + position ) | ||
] | ||
}, | ||
children: [ | ||
{ | ||
tag: 'span', | ||
|
||
attributes: { | ||
class: [ | ||
'ck-tooltip__text' | ||
] | ||
}, | ||
|
||
children: [ | ||
{ | ||
text: bind.to( 'text' ), | ||
} | ||
] | ||
} | ||
] | ||
} ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.