How to remove the "max-height" online style of modal? - html

I created a code that displays a link to open a modal window.
The problem is that the text comes out of the window.
When I inspect the code of my page, there is an online style style="max-height: 570px;"
If I add the following code to my style sheet, it works. But is there another solution? I make a mistake in my code :
div#drupal-modal--content[style] {
max-height: none !important;
}
How to remove the online style of modal ?
public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {
$store_name = $this->order->getStore()->getName();
$store_id = $this->order->getStoreId();
$pane_form['#attached']['library'][] = 'core/drupal.dialog.ajax';
$attributes = [
'attributes' => [
'class' => 'use-ajax',
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode([
'width' => auto,
]),
],
];

Related

Yii2 Gridview CheckboxColumn, background color of the check box cell

Is there any way to set a background color only for the checkbox column?
Thanks.
for styling column properties you can use options
......
'columns' => [
// ...
[
'class' => 'yii\grid\CheckboxColumn',
/ you may configure additional properties here
'options' => ['class'=> 'your_check_box_class' , style =>'background-color: #ff0000;'],
],
],
for checkbox content you can use contentOptions
http://www.yiiframework.com/doc-2.0/yii-grid-checkboxcolumn.html

yii2 AutoComplete position

It was working perfectly, I have changed nothing, and I have realized that my AutoComplete widget is showing up not there where it was before (it was in the gridView, right underneath the filter textinput where it is expected). Now it shows up in the left upper corner of the page, with the first 2-3 options covered by the navbar. Is there a change in AutoComplete, or in Yii2 now? I have found an option appendTo that has maybe something to do with the problem, and I have done experiments with it but no luck, either it doesn't show up, or still on the wrong place. I have found nothing else relevant.
Here is my code in the gridview:
[
'attribute' => 'name',
'contentOptions' => ['nowrap' => 'nowrap'],
'filter' => AutoComplete::widget([
'model' => $searchModel,
'attribute' => 'name',
'clientOptions' => [
'source' => Pl::find()->allAutoCompleteName(),
'autoFill' => true,
],
'options' => ['class' => 'form-control']
]),
],
The id of the search field is plsearch-name
The js:
jQuery('#plsearch-name').autocomplete({"source":[{"value":"PE 150","label":"PE 150"}...],"autoFill":true});
If I'm setting the appendTo in clientOptions to '#plsearch-name', then it doesn't show up at all, however it is correct, isn't it? I don't see any styling in it.
What also quite interesting is:
<input
type="text"
id="plsearch-name"
class="form-control ui-autocomplete-input"
name="PlSearch[name]"
autocomplete="off"/>
What is this autocomplete="off" doing there?
Can you please point me to the right direction? Thanks a lot!
This Problem is fixed here: https://github.com/yiisoft/yii2-jui/commit/36468550d72bce9d963149abe85b13ea2f3a8c18
The JQuery UI Version should be updated to 1.12
"require": {
"yiisoft/yii2": "~2.0.4",
- "bower-asset/jquery-ui": "1.11.*#stable"
+ "bower-asset/jquery-ui": "~1.12.1"
},

Add class to Wordpress sidebar navigation lists

I'm just wondering if there's a way to add a class to any navigation lists for things like sub-pages, categories, archives, meta?
I can't find anywhere in my templates to add a class as I guess it's all autogenerated?
My parent theme (html5blank) has a section of code (below) where this is referenced but I think it targets all lists in the sidebar...
if (function_exists('register_sidebar'))
{
// Define Sidebar Widget Area 1
register_sidebar(array(
'name' => __('Widget Area 1', 'html5blank'),
'description' => __('Description for this widget-area...', 'html5blank'),
'id' => 'widget-area-1',
'before_widget' => '<div id="%1$s" class="%2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
// Define Sidebar Widget Area 2
register_sidebar(array(
'name' => __('Widget Area 2', 'html5blank'),
'description' => __('Description for this widget-area...', 'html5blank'),
'id' => 'widget-area-2',
'before_widget' => '<div id="%1$s" class="%2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
I realised I can add a class to a parent div by amending the before_widget line to read something like:
'before_widget' => '<div id="%1$s" class="%2$s CUSTOM-CLASS-HERE">',
That does add a class but I still thing it'll be added to any and every widget that's added to the sidebar?
Presumably that will mean any widget that contains a ul will inherit styles applied to that class, which will break the widget's appearance?
Hope someone can help with this :)
You can add classes to menu items (or to menus) from WP Dashboard.
Appearance > Menus > Screen Options
Show Advanced > CSS Classes
Click any menu item to expand and add classes.
In CSS, you can always prefix those the classes with a specific id or class of a widget area, to only apply styles in specific sidebars/widget areas.
if you need to add a class to all your menu items programatically, use the
nav_menu_link_attributes hook:
function add_your_menu_classes( $atts, $item, $args ) {
if( /* condition based on $args or $item (WP_Post object)
* (in case you only want this when a particular condition
* is met). If not, just remove the condition */ ) {
$atts['class'] = 'some-class';
}
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_your_menu_classes', 10, 3 );
I think if ur widgets, displays a kind of navigation you have to use a custom NavWalker to modify link classes
https://github.com/wp-bootstrap/wp-bootstrap-navwalker

render page without footer yii2

I am trying render page in grid view, it was success but the footer is show on the column i render, how to remove its
This is the colomn GridView i write :
[ 'format' => 'raw',
'value' => function($model) { return "<p class='feedback'>". $model->KOMENTAR ."</p><br><p class='feedback-date'>". $model->TANGGAL ."</p><hr><div id='replay-". $model->ID_KOMENTAR."'><ul></ul><div id='replay-column'></div></div>";},
],
I render the page inside div class="replay-column"
This the following js i made for rendering page when i click button:
$("#replay-to-"+ID_KOMENTAR).on("click", function(){
$.get('index.php?r=feedback/feedbacktest',null, function(data){
$('#replay-column').append(data);
});
});
And this the controller :
public function actionFeedbacktest(){
echo $this->render('feedback_test');
}

Style form elements in laravel stapler

In code I made this form element (I am using laravel stapler package) :
{{ Form::file('images', array('class' =>"btnUpload")) }}
This is an image of how this is shown in my browser and in developer tools :
I have given it a class but the styling I give is given to the surroundings not to the button bestand kiezen itself.
css code :
.btnUpload {
padding : 100px;
height : 100px;
width 20%;
}
.btnUpload > button {
width : 200px;
height : 200px;
}
I fixed it by declaring the form elements like this :
{{Form::textarea('alt_description', null, array(
'id' => 'pictureDescriptionInput',
'class' => 'form-control',
'rows' => 10,
'name' => 'alt_description',
'placeholder' => 'Description',
'type' => 'text'
));
}}