React Bootstrap: How to use all columns for small devices and fixed width for medium devices - react-bootstrap

I have a React Bootstrap column which right now looks this way:
<Col xs={12} md={3}>
I want to modify it so it has a fixed width of 500 for medium devices and tried to apply
className="d-flex flex-md-grow-0 flex-md-shrink-0" but that doesn't seem to work. Also I don't know how to set flex-basis to apply the 500px width or do I have to combine it with w-500?
Many thanks in advance

You can set an css max-width at col-md-
const Grid = ReactBootstrap.Grid;
const Row = ReactBootstrap.Row;
const Col = ReactBootstrap.Col;
const Hello = React.createClass({
getInitialState() {
return { showModal: false };
},
render() {
return (
<Grid>
<Row>
<Col className="hello" xs={12} md={12}>
Hello
</Col>
</Row>
</Grid>
);
}
});
ReactDOM.render(
<Hello name="World" />,
document.getElementById('container')
);
html, body {
height: 100%;
}
.col-md-12 {
max-width: 500px;
background-color: red;
}
<link href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet'>
<div id="container"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.5/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap/0.28.1/react-bootstrap.min.js"></script>

Related

Hide/Show Mapbox points/clusters based on client side filtering?

I have a webpage that offers clients to perform filter operations.
See image of my interface here. The user can filter results based on the countries in the squares.
Everything is working fine, my view updates perfectly when user filters.
However, I cannot find a solution to update the map on filter, like I am updating the content.
I am wondering how to ask Mapbox to listen for click event outside of the map, or to stay updated with what is filered on the interface.
It's the same example than this, except that instead of having to click on the menu inside the map to filter the results on the map, I want the results on the map to be automatically filtered based on my other filter (the one with square regions of the world, shown on my interface
here
Thanks!
You can use the map variable to trigger map changes from outside the map:
mapboxgl.accessToken = 'pk.eyJ1Ijoiam93ZXQiLCJhIjoiY2wzcTlhOTc0MTJ5aDNwbDJlNG5ncDAzZiJ9.PiDzh6BzO92pueGLxv1w5g';
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [-87.661557, 41.893748],
zoom: 10.7
});
var flyToButton = document.getElementById('flyToButton');
flyToButton.addEventListener('click', handleZoomButtonClick);
function handleZoomButtonClick() {
map.flyTo({
center: [-74.5, 40],
essential: true
});
}
var addLayerButton = document.getElementById('addLayerButton');
addLayerButton.addEventListener('click', handleAddLayerButton);
function handleAddLayerButton() {
map.addSource('urban-areas', {
'type': 'geojson',
'data': 'https://docs.mapbox.com/mapbox-gl-js/assets/ne_50m_urban_areas.geojson'
});
map.addLayer({
'id': 'urban-areas-fill',
'type': 'fill',
'source': 'urban-areas',
'layout': {},
'paint': {
'fill-color': '#f08',
'fill-opacity': 0.4
}
});
}
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#flyToButton {
position: absolute;
}
#addLayerButton {
position: absolute;
top: 30px
}
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>Points on a map</title>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.8.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.8.1/mapbox-gl.css' rel='stylesheet' />
</head>
<body>
<div id='map'></div>
<button id="flyToButton">Fly to</button>
<button id="addLayerButton">Add layer</button>
</body>
</html>
How you can implement the filter functionality depends on the type of your data. But probably the following mapbox example will help you: Filter features within map view

How to get Kendo DateTimePicker format to work like 'toLocaleString'?

I want the Kendo DateTimePicker to be formatted just as new Date()).toLocaleString("UTC", {timeZone: "UTC"}) + " (UTC)" formats its output string (e.g. ‎2015‎.‎04‎.‎23‎ ‎22‎:‎15‎:‎54 (UTC)). I have been able to set the value: using toLocaleString and get the correct initial format for the date and time but once the date or time values have been changed using the calendar dropdown the format goes back to default. I cannot figure out how to set the format property to get the correct result.
Here is the code I was experimenting with in the Kendo UI Dojo:
http://dojo.telerik.com/iFiNO/2
<!DOCTYPE html>
<html>
<head>
<base href="http://demos.telerik.com/kendo-ui/datetimepicker/index">
<style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style>
<title></title>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.material.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.dataviz.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.dataviz.material.min.css" />
<script src="http://cdn.kendostatic.com/2015.1.408/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2015.1.408/js/kendo.all.min.js"></script>
</head>
<body>
<input id="datetimepicker" />
<script>
$("#datetimepicker").kendoDateTimePicker({
value: (new Date()).toLocaleString("UTC", {timeZone: "UTC"}) + " (UTC)",
format: "g"
});
</script>
</body>
</html>
On the Kendo UI demo site, they have an example of globablization on a date and time picker (here: http://demos.telerik.com/kendo-ui/globalization/index) Here is the full code example:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="styles/kendo.common.min.css" />
<link rel="stylesheet" href="styles/kendo.default.min.css" />
<link rel="stylesheet" href="styles/kendo.dataviz.min.css" />
<link rel="stylesheet" href="styles/kendo.dataviz.default.min.css" />
<script src="js/jquery.min.js"></script>
<script src="js/kendo.all.min.js"></script>
</head>
<body>
<script src="../content/web/globalization/cultures/kendo.culture.en-US.js"></script>
<script src="../content/web/globalization/cultures/kendo.culture.en-GB.js"></script>
<script src="../content/web/globalization/cultures/kendo.culture.de-DE.js"></script>
<script src="../content/web/globalization/cultures/kendo.culture.fr-FR.js"></script>
<script src="../content/web/globalization/cultures/kendo.culture.bg-BG.js"></script>
<div id="example">
<div id="product-view" class=" demo-section k-header">
<div class="right">
<label for="culture">Choose culture:</label>
<input id="culture" value="en-US" />
</div>
<h2>Product promotion</h2>
<ul id="fieldlist">
<li>
<label for="startDate">Discount start date:</label>
<input id="startDate" />
<input id="startTime" value="12:00 AM" />
</li>
<li>
<label for="endDate">Discount end date:</label>
<input id="endDate" />
<input id="endTime" value="12:00 AM" />
</li>
<li>
<label for="initial">Initial price:</label>
<input id="initial" value="10" min="1"/>
</li>
<li>
<label for="discount">Discount:</label>
<input id="discount" value="0.05" min="0" max="0.5" step="0.01"/>
</li>
</ul>
</div>
<style>
#example h2 {
padding: 5px 0 15px;
font-weight: normal;
border-bottom: 1px solid rgba(128,128,128,.3);
}
#product-view {
overflow: hidden;
width: 600px;
padding: 20px 20px 0 20px;
margin: 30px auto;
background-position: 0 -255px;
}
.right
{
float:right;
}
#fieldlist
{
width: 100%;
float:left;
margin:0;
padding: 10px 0 30px 0;
}
#fieldlist li
{
list-style:none;
padding:5px 0;
}
#fieldlist label {
display: inline-block;
width: 140px;
text-align: right;
}
</style>
<script>
$(document).ready(function() {
function startDateChange() {
var date = startDate.value();
if (date) {
date = new Date(date);
date.setDate(date.getDate() + 1);
endDate.min(date);
}
}
function endDateChange() {
var date = endDate.value();
if (date) {
date = new Date(date);
date.setDate(date.getDate() - 1);
startDate.max(date);
}
}
function changeCulture() {
kendo.culture(this.value());
var datePickerOptions = {
format: kendo.culture().calendar.patterns.d
};
var timePickerOptions = {
format: kendo.culture().calendar.patterns.t
};
startDate.setOptions(datePickerOptions);
endDate.setOptions(datePickerOptions);
startTime.setOptions(timePickerOptions);
endTime.setOptions(timePickerOptions);
initial.value(initial.value());
discount.value(discount.value());
}
var startDate = new kendo.ui.DatePicker($("#startDate"), { change: startDateChange });
var endDate = new kendo.ui.DatePicker($("#endDate"), { change: endDateChange });
var startTime = new kendo.ui.TimePicker($("#startTime"));
var endTime = new kendo.ui.TimePicker($("#endTime"));
var initial = new kendo.ui.NumericTextBox($("#initial"), { format: "c" });
var discount = new kendo.ui.NumericTextBox($("#discount"), { format: "p" });
var today = new Date();
startDate.value(today);
endDate.min(today);
today = new Date(today);
today.setDate(today.getDate() + 1);
endDate.value(today);
startDate.max(today);
$("#culture").kendoDropDownList({
change: changeCulture,
dataTextField: "text",
dataValueField: "value",
dataSource: [
{text: "bg-BG", value: "bg-BG"},
{text: "de-DE", value: "de-DE"},
{text: "en-US", value: "en-US"},
{text: "en-GB", value: "en-GB"}
]
});
});
</script>
</div>
</body>
</html>
The globalization files link to: http://demos.telerik.com/kendo-ui/content/web/globalization/cultures/kendo.culture.en-US.js . The pattern is kendo.culture.{culturename}. This page http://cdnjs.com/libraries/kendo-ui-core provides CDN links to a ton of Kendo culture files for various languages.
Hopefully this should provide you with enough of an example to be able to adjust the format of the date/time picker. In the code example above, there is a spot where they show how to change the pattern option:
var datePickerOptions = {
format: kendo.culture().calendar.patterns.d
};
The last piece is figuring out which culture you actually need. In the example above, the line
kendo.culture(this.value());
changes the culture. You can read more about this built-in Kendo function here: http://docs.telerik.com/kendo-ui/api/javascript/kendo#methods-culture
If you simply call kendo.culture() it will return the current culture. So the line
format: kendo.culture().calendar.patterns.d
sets the pattern for the current culture. Of cource for this to work, you have to have the correct culture file loaded.
If you look more in depth at one of the culture files, you can see the patterns and what formats they represent:
(function( window, undefined ) {
kendo.cultures["en-US"] = {
name: "en-US",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n %","n %"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
pattern: ["($n)","$n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "$"
}
},
calendars: {
standard: {
days: {
names: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
namesAbbr: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
namesShort: ["Su","Mo","Tu","We","Th","Fr","Sa"]
},
months: {
names: ["January","February","March","April","May","June","July","August","September","October","November","December",""],
namesAbbr: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]
},
AM: ["AM","am","AM"],
PM: ["PM","pm","PM"],
patterns: {
d: "M/d/yyyy",
D: "dddd, MMMM dd, yyyy",
F: "dddd, MMMM dd, yyyy h:mm:ss tt",
g: "M/d/yyyy h:mm tt",
G: "M/d/yyyy h:mm:ss tt",
m: "MMMM dd",
M: "MMMM dd",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "h:mm tt",
T: "h:mm:ss tt",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM, yyyy",
Y: "MMMM, yyyy"
},
"/": "/",
":": ":",
firstDay: 0
}
}
}
})(this);
There are a number of reference that will show you how to load a script file using script. Or you can load them all, or combine them into one large JS file and minify it or something. You could also load the culture files from that CDN, or of course download them to your server and host them locally.

jQuery SlideToggle and random color

I have a jsfiddle here to illustrate my question
http://jsfiddle.net/ttmt/DgnLd/1/
It's just a simple button with a hidden div. The button slide toggles the hidden div.
I would like to have div filled with a random color each time it opens.
At the moment it's picking two random colors - when the div is opening and when the finished opening.
How can I stop the second color and just have one.
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css">
<style type="text/css">
•{
margin:0;
padding:0;
}
#wrap{
margin:20px;
}
#btn{
width:100px;
height:50px;
background:red;
color:white;
padding:10px;
margin:0 0 50px 0;
}
#infoDiv{
width:500px;
height:300px;
display:none;
}
</style>
</head>
<body>
<div id="wrap">
CLICK
<div id="infoDiv">
</div>
</div>
<script>
$(document).ready(function(){
alert('here');
var color_arr = ['#6faab6','#80c3d1','#888888','#d8e420','#21b4e4','#e4b115','#33ace4'];
$('#infoDiv').hide();
$('#btn').bind('click', function(){
$('#infoDiv').slideToggle('slow', function(){
var ranNum = Math.floor(Math.random()*color_arr.length);
var col = color_arr[ranNum];
$('#infoDiv').css({'background': col});
});
});
});
</script>
</body>
</html>
$(document).ready(function(){
var color_arr = ['#6faab6','#80c3d1','#888888','#d8e420','#21b4e4','#e4b115','#33ace4'];
$('#infoDiv').hide();
$('#btn').bind('click', function(){
var ranNum = Math.floor(Math.random()*color_arr.length);
var col = color_arr[ranNum];
$('#infoDiv:hidden').css({'background': col});
$('#infoDiv').slideToggle('slow');
});
});​
Try that -- I've moved your Random color picker out of the SlideToggle callback as that will only run once the slide was finished which from your question I assumed you didn't want.
It also only changes the color of the info div if it's hidden by checking the visible selector, you can read more about that here
Let me know if that works for you

why do i get scroll bars when using google line chart?

I am using google line chart api and no matter how big i make the div chart dimentions, it always shows a horizontal and vertical scroll bar. how can i stop this from happening.
CONTEXT: editable HTML of https://code.google.com/apis/ajax/playground/?type=visualization#line_chart (using Firefox or Chorme).
Instructions for help you in the problem:
suppose you need a box with width=500px and height=400px.
check Javascript at new google.visualization.LineChart(), if the width and height inicializations are 500 and 400.
check if style of the HTML tag (perhaps div) of renderization place (id="visualization") is style="width: 800px; height: 400px;".
check if style of the HTML parent tag (any) of renderization place is bigger than 500 and 400, or is 100%.
Another solution is by "HTML cut": use overflow:hidden.
EXAMPLE OF CASE WITH SCROLL
// ... piece of your javacascript.
new google.visualization.LineChart(document.getElementById('visualization')).
draw(data, {curveType: "function",
width: 800, height: 400,
vAxis: {maxValue: 10}}
);
} google.setOnLoadCallback(drawVisualization);
<!-- ... piece of your HTML -->
<div id="container" style="width:400px;overflow:scroll;">
<div id="visualization" style="width: 800px; height: 400px;"></div>
</div>
HTML SOLUTION (fix the container width)
<!-- ... piece of your HTML -->
<div id="container" style="width:800px;overflow:scroll;">
<div id="visualization" style="width: 800px; height: 400px;"></div>
</div>
ANOTHER SIMPLE HTML SOLUTION (use overflow:hidden)
<!-- ... piece of your HTML -->
<div id="container" style="width:400px;overflow:hidden;">
<div id="visualization" style="width: 800px; height: 400px;"></div>
</div>
... or reduce all, Javascript and HTML widths and heights, etc.
Using :
<script src="https://www.google.com/jsapi"></script>
<script>
google.load("visualization", "1", {packages:["corechart"]});
var data = new google.visualization.DataTable();
//init your data
var options = {
width: "100%", height: "100%",
//other options
}
var chart = new google.visualization.LineChart(document.getElementById('chart'));
chart.draw(data, options);
</script>
....
<body>
<div id="chart"></div>
</body>
You ensure that the graph will fit the div you're using.
Then to resize the graph set style="width: ...px; height: ...px;" with the desired size :
<body>
<div style="width: 800px; height: 400px;" id="chart"></div>
</body>

CKEditor 3.0 Height

Is there a way to set the height of CKEditor 3.0 to a percentage, such as 100%, such that it takes up the whole window?
I am currently using absolute values, but they do not blend well with my UI :(
CKEDITOR.replace('editor1',{
height: '600px'
});
First add a function for resizing your edtior:
function resizeEditor() {
var defaultHeight = 300;
var newHeight = window.innerHeight-150;
var height = defaultHeight > newHeight ? defaultHeight: newHeight;
CKEDITOR.instances.editor1.resize('100%',height);
}
Note: 150 works for me, maybe change the value from 150 to more or less.
Call this from the window onresize Event:
window.onresize = function() {
resizeEditor();
}
and add the first call to the constructor of your editor:
CKEDITOR.replace('editor1',
{
on:
{
instanceReady: function(ev)
{
setTimeout(resizeEditor, 500);
}
}
});
After a lot of fiddling with this resizing stuff on ckeditor 4 I made up this which works perfectly perfectly for me:
in config.js:
// prevent flashing of resizing by setting the content panel to zero height before it is resized
config.height = '0px';
config.width = '100%';
jQuery:
$(document).ready(function(){
// resize the editor(s) while the instance is ready
CKEDITOR.on('instanceReady', function() {
var textEditHeight = $(".textPanel").height();
var ckTopHeight = $("#cke_1_top").height();
var ckContentsHeight = $("#cke_1_contents").height();
for (var i = 1; i < 10; i++) {
$("#cke_"+i+"_contents").height( (textEditHeight - ckTopHeight - 10) + "px");
}
});
// resize the editor(s) while resizing the browser
$(window).resize(function(){
var textEditHeight = $(".textPanel").height();
var ckTopHeight = $("#cke_1_top").height();
var ckContentsHeight = $("#cke_1_contents").height();
for (var i = 1; i < 10; i++) {
$("#cke_"+i+"_contents").height( (textEditHeight - ckTopHeight - 10) + "px");
}
});
});
I have multiple instances of the editor of the exact same size in tabs, for every language one, hence the for loop. If you have one editor you can leave that line away and use the standard id cke_1_contents.
In this example the heights are taken from the first editors toolbar (cke_1_top) and contentpanel (cke_1_contents). The .textPanel height is the surrounding div were the editor should fit in. I added 10px because I needed that for my layout.
I think it can be a littlebit more efficiënt (it initiates the resizing as many times as there are editors) but for now it is finally working flawlessly in all my recent browsers (ff, ie, chrome and safari).
I managed to configure a 100% height via CSS:
Configure the editor with config.height = '100%', even when the docs say this isn't supported.
Put this in your CSS:
span.cke_wrapper cke_ltr,table.cke_editor, td.cke_contents, span.cke_skin_kama, span.cke_wrapper, span.cke_browser_webkit{
height: 100%!important;
}
I tested this with Chrome, Firefox and Safari and it worked fine. Since this is pure CSS, the height will get adjusted automatically when the window or the corresponding container is resized.
The documentation on ckeditor for CKEDITOR.config.height say that they do not support percentage units e.g.: 30%;
however, there is a td with a class of cke_contents. if you set the height on that (with an absolute value it will work).
It seems that ckeditor does not have a good solution for this problem.
The only other way I can think of is to use javascript to change the style on the above td.
None of the above solutions worked fine for me in order to set the height either with percentage or without it. Percentages are still not supported at all unless you hack it with one of the above solutions.
As stated in the documentation, you may set the height and css style with:
<head>
<script type="text/javascript">
CKEDITOR.config.height = 1000;
CKEDITOR.config.contentsCss = '/css/yourstyle.css';
</script>
</head>
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.height
Put this property in your css config file:
.cke_reset{
min-height: 200px;
}
here is the dojo version of the code above... in case anyone is interested...
var adjustEditor = function() {
var editorNode = dom.byId('cke_messageEditor');
console.log("editor node %s ", editorNode);
var editorStyle = domStyle.getComputedStyle(editorNode);
console.log("editor node %s and style %s", editorNode, editorStyle);
var textEditHeight = domGeom.getMarginBox(editorNode, editorStyle).h;
var toolbarNode = dom.byId('cke_1_top');
var toolbarStyle = domStyle.getComputedStyle(toolbarNode)
var ckTopHeight = domGeom.getMarginBox(toolbarNode, toolbarStyle).h;
var contentNode = dom.byId('cke_1_contents');
var contentStyle = domStyle.getComputedStyle(contentNode)
var ckContentsBox = domGeom.getMarginBox(contentNode, contentStyle);
console.log("text editor: %s, button bar: %s", textEditHeight, ckTopHeight);
console.log("setting margin box to: %s ", JSON.stringify(ckContentsBox));
ckContentsBox.h = textEditHeight - ckTopHeight;
console.log("setting margin box to: %s ", JSON.stringify(ckContentsBox));
domGeom.setMarginBox(contentNode, ckContentsBox, contentStyle);
}
// adjust editor immediately
CKEDITOR.on('instanceReady', adjustEditor);
// and again everytime the window is resized
on(window, "resize", adjustEditor);
I have been looking for a clean way to get the CKEditor window to be the same height as the textarea it is replacing. I'm using Drupal, and this is how I did it ...
In my theme I load up a javascript file, (using "scripts[] = default.js" in my .info file).
In this file I have:
$(document).ready(function(){
// Set CKEditor height
if (typeof CKEDITOR!='undefined') {
CKEDITOR.on( 'instanceReady', function( e ) {
e.editor.element.show();
var elHeight = $(e.editor.element.$).height();
e.editor.element.hide();
e.editor.resize('100%', elHeight, true);
});
}
}
The beauty of this is you can then change the height using css.
I had been changing the settings.height via the wysiwyg module in wysiwyg/editors/js/ckeditor-3.0.js
Drupal.wysiwyg.editor.attach.ckeditor = function(context, params, settings) {
// Apply editor instance settings.
CKEDITOR.config.customConfig = '';
// Match the height of the replaced field
settings.height = $('#' + params.field).height();
}
but this would get overwritten during updates, so went with the top solution.
I just got around doing this in CKEditor4, not sure if it is any use to you
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="ckeditor/ckeditor.js"></script>
<!-- tested with CKEditor 4.5.3 (revision 6c70c82) -->
<style type="text/css">
.cke_1 {
height: 100% !important;
width: 100% !important;
position: static;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
}
.cke_inner {
height: 100% !important;
width: 100% !important;
display: table !important;
}
.cke_top { display: table-cell !important; }
.cke_contents { height: 100% !important; display: table-row !important; }
.cke_bottom { display: table-cell !important; }
textarea.cktextarea {
width: 100% !important;
height: 100% !important;
}
</style>
<script>
CKEDITOR.config.width = '100%';
CKEDITOR.config.height = '100%';
CKEDITOR.plugins.registered['maximize'] = {
init: function(editor) {
var command = editor.addCommand('maximize', {
modes: { wysiwyg:1, source:1 },
exec: function(editor) {
if (editor.container.getStyle('position') != 'fixed') {
this.setState(CKEDITOR.TRISTATE_ON);
editor.container.setStyle('position', 'fixed');;
} else {
this.setState(CKEDITOR.TRISTATE_OFF);
editor.container.setStyle('position', 'static');
}
}
});
editor.ui.addButton('Maximize', { label: 'Maximize', command: 'maximize', toolbar: 'tools' });
}
}
</script>
</head>
<body>
<div style="background: darkgray; padding: 0.5em; display: inline-block; position: fixed; left: 20px; top: 20px; left: 20px; right: 20px; bottom: 20px;">
<textarea name="editor1" id="editor1" class="cktextarea"></textarea>
<script>CKEDITOR.replace('editor1');</script>
</div>
</body>
</html>
If you are not using the maximize plugin a lot of the javascript is unnecessary, I replaced the functionality of this plugin because it was breaking the new CSS (and breaking by itself after I set all the CSS !important).
This is solution for me, without jQuery, working in C# WebBrowser control, also no vertical scroll when horizontal shown.
<!DOCTYPE html>
<!--
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8" http-equiv="X-UA-Compatible" content="IE=edge">
<title>CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<script src="js/sample.js"></script>
<link rel="stylesheet" href="css/samples.css">
<link rel="stylesheet" href="toolbarconfigurator/lib/codemirror/neo.css">
</head>
<body id="main">
<div id="editor">
</div>
<script>
initSample();
CKEDITOR.on("instanceReady", function () { initFullSize(); });
function initFullSize() {
window.addEventListener("resize", onWindowResize);
document.getElementById("main").style.minWidth = "970px";
document.getElementById("cke_1_resizer").style.display = "none";
document.getElementsByClassName("cke_inner cke_reset")[0].style.height = "100%";
onWindowResize();
}
function onWindowResize() {
document.getElementById("main").style.height = document.documentElement.clientHeight + "px";
document.getElementById("cke_editor").style.height = document.documentElement.clientHeight - 3 + "px";
document.getElementById("cke_1_contents").style.height = (document.documentElement.clientHeight - document.getElementById("cke_1_top").clientHeight - document.getElementById("cke_1_bottom").clientHeight - 3) + "px";
}
</script>
</body>
</html>

Resources