AngularJS Bootstrap dialog to grow with content up to a max height - angularjs

I'm using AngularJS and Bootstrap 2.3.2. Right now, it appears bootstrap has a max-height set to 400px. I'd like to allow the content of the dialog to stretch the dialog up to 90% of the window. How can I do this?

When using bootstrap, I like to overwrite some of it with my own CSS. So I would find the CSS selector in the bootstrap.css file that sets the max-height to 400px. Then use that same selector in your own stylesheet (linked below the bootstrap css so that it overwrites it) to set the max-height to 90%.
Edit: the css selector you're looking for is
.modal-body {}

Related

Is there a way to target some reac-bootstrap component css?

Is there any way to target some components from react-bootstrap in CSS. For my application, I'm using Modals from react-bootstrap and I need to change some style on all of them and it will be annoying if I need to change every single one individually.
Yes, it is possible, however you will need to inspect the Modal using ChromeDevTools or the like and see what classes are applied to the Modal when it is displayed. For example, when I inspected the Modal from react-bootstrap, I noticed the styles applied to the heading were given the className of "modal-header". So I created a Modal.css file and added the following code to it:
.modal-header {
background-color: red;
}
Then, I imported "./Modal.css" into the Modal.js file or wherever you've defined or using your Modal. Finally, when I opened the Modal, the heading had a background of red color so to speak.
Please note that it can be a little difficult to override bootstrap styles sometimes.

How do i make modal placement and animations work in angular-strap

I have setup my project to use angular strap with bootstrap and while a button with the bs-modal attribute opens a modal without issues the data-placement and data-animation attributes are not doing anything. i tried passing the animation and placement as defaults via the directive config but that does not help either.
I have:
angular (with angular-animate.js), angular-strap (including angular-strap.tpl.js), bootstrap js files loaded
i have the angular-motion.css file loaded too
the modal opens at the top, without animation whatever i set for animation or placement
Am i missing more css or js requirements not in the docs?
Ok figured this out after some tinkering. The animation did not work because obviously you have to inject the animate js into the directive too if you want to use it:
angular.module('myApp', ['ngAnimate', 'mgcrea.ngStrap']);
This is actually mentioned on the github page but not in the docs so i missed that.
The placement not working seems to be an issue with the base bootstrap css not actually supporting the center class for modals. Maybe a bit unfortunately the docs use this as an example but this will only work if you add the css for this yourself. So to actually use:
data-placement="center"
.. you will either have to load the css from the docs here: http://mgcrea.github.io/angular-strap/styles/libraries.min.css
or just copy the part for centering modals:
.modal.center .modal-dialog {
position:fixed;
top:40%;
left:50%;
min-width:320px;
max-width:630px;
width:50%;
-webkit-transform:translateX(-50%) translateY(-50%);
transform:translateX(-50%) translateY(-50%)
}

Using flexbox layout with angular-ui tabs

I wan't to use flexbox layout with angular ui tabs (ui.bootstrap.tabs). I have this plunker:
http://plnkr.co/edit/9ToL1WLwgDVT0DldMnaa
I changed the ui-template thus all div's get the flexbox classes. Still the tab content div is not filling up the fully available space.
Any idea?
I have found a solution. Here is an updated plunker:
http://plnkr.co/edit/oswSGYApFj9sSohms0FS?p=preview
The key is to override the display property of the '.tab-content>.active' class. By default it is set to 'display: block'. It has to be set to 'display: flex'.

Ext.get('myPanel').el.setOpacity(0.65) is not working in IE 8 compatibility mode

I'm trying to set opacity for extjs (4.2.1) panel (whose id is myPanel) as Ext.get('myPanel').el.setOpacity(0.65). It works fine in firefox and chrome but not in IE 8. The ultimate goal is to make the panel transparent so that the user can see through it. Could any one please help me with this...
Ext will simply apply the CSS property "opacity" or alpha transparency to an HTML element. In IE8 this is almost in no case supported.
You could however use a plugin or hack to make IE 8 compatible with it.
Check http://css3pie.com/ or http://modernizr.com/ for example.
Also check http://www.electrictoolbox.com/opacity-internet-explorer-css3-pie-alpha-transparency/ for an example of your issue, and how it is solved using PIE
When you dont want to use 3rd party plugins, you can also try this:
Add the following rules to the CSS of your property
/* IE8 */-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */ filter: alpha(opacity=50);
You can also do this with Ext.js using Ext.get('myPanel').el.setStyle()
e.g.
Ext.get('myPanel').el.setStyle('-ms-filter','progid:DXImageTransform.Microsoft.Alpha(Opacity=50)');
Finally..after breaking my head for as while..I came up with 2 solutions...
1) Apply x-panel-ghost (which is an extjs in build css applied during the drag process) for baseCls or componentCls gave the transparency. But all the other default css for a extjs panel are lost and so we have to manually write them up..
2) The best solution would be to set an image which is made transparent (through photoshop or something) as a background image for the panel header and body and apply it to the cls config of the panel as below:
In panel:
cls: 'transparency',
In css file:
.transparency .x-panel-header{
background: transparent url('../image.png') no-repeat center !important;
}
And in the same way, for the body as well..
Hope this helps someone...

Does Angular.JS add CSS styles or changes existing styles?

This is a weird one we're currently porting an existing CakePHP app to Angular.JS, the CSS is the same and overall everything looks the same but there is small changes for example the font type or the size, also noticing small difference in spacing, padding and margins.
Does Angular add CSS style or overwrite existing styles?
AngularJS does not add any style elements nor does it add or remove any inline styles. It does however add classes to DOM elements such as ng-scope, ng-binding..etc all with the "ng" prefix.
Angular does add a few CSS styles, but nothing that would account for what you're seeing.
In particular, to hide elements while they're loading through an ngCloak directive, Angular adds a class to set the display property to 'none'.
You can see Angular's CSS in https://github.com/angular/angular.js/blob/master/css/angular.css.

Resources