How to disable menubutton in Polymer's core-scaffold? - dom

How to disable menubutton in Polymer's core-scaffold? And I want to disable drawer-panel in core-scaffold.

Its embedded in core-scaffold as you can see from it's source code (core-icon-button):
<core-toolbar>
<template if="{{!rightDrawer}}">
<core-icon-button id="menuButton" icon="menu" on-tap="{{togglePanel}}"></core-icon-button>
</template>
<content select="[tool]"></content>
<template if="{{rightDrawer}}">
<core-icon-button id="menuButton" icon="menu" on-tap="{{togglePanel}}"></core-icon-button>
</template>
</core-toolbar>
https://github.com/Polymer/core-scaffold/blob/master/core-scaffold.html
You are better of building your scaffolding yourself using above url as a guide.
Also you might look into polymer 1.0 and Polymer Starter Kit which will allow you change or remove the icon

Related

Add aria-hidden to Title element

I am trying to make a business critical SAPUI5 application more accessible using screen readers by adding ARIA labels and landmarks. One issue is that some SAPUI5 elements such as sap.m.Title's without text have been used (abused) for layout purposes. I would like to add the aria-hidden attribute or a SAPUI5 analogue to these Title elements. But I can't figure out how to do this. I would like to change
<Title text="" class="title" />
into
<Title aria-hidden="true" text="" class="title" />
But setting aria-hidden on the Title like this seems to be invalid. How would I go about setting a standard HTML attribute on a SAPUI5 control?
Thank you in advance for your help!
Joshua

laravel backpack: how to use tooltip in datatables cells?

I override show.blade.php to have a button with a tooltip
<a href="{{ url($crud->route.'/'.$entry->getKey().'/show') }}"
class="btn btn-sm btn-primary"
data-toggle="tooltip" data-placement="top" title="{{ trans('backpack::crud.preview') }}"
>
<i class="la la-eye"></i>
</a>
But this do not works. I think because datatable is loaded on ajax and/or tooltip is not initialized anywhere
Where should I do this sort of "auto init" of tooltip ?
More general question:
how to simply override backpack for laravel's crud blades, for example for simply adding some custom js?
I add my own solution that also resolves a common and basic problem:
how to simply override backpack for laravel's crud blades, for example for simply adding some custom js?
In the setup() method of my UsersCrudController I added thesse to use customized views
$this->crud->setCreateView('anagraphics.users.create');
$this->crud->setEditView('anagraphics.users.edit');
Then to override without publishing and without copy/paste I created
resources/views/anagraphics/users/create.blade.php
resources/views/anagraphics/users/edit.blade.php
Then in create.blade.php:
#extends('crud::create')
#push('after_scripts')
<script type="application/javascript">
</script>
#endpush
And in edit.blade.php:
#extends('crud::edit')
#push('after_scripts')
<script type="application/javascript">
</script>
#endpush
I suggest to document that you can extends original blade using
#extends('crud::<operation_name')
What happens when you execute this from the browser console after the table has loaded?
$('[data-toggle="tooltip"]').tooltip()

Why are Breadcrumbs sapui5 minimized?

in my SAPUI5-application i use breadcrumbs. This feature is quite nice, but on a specific word ("Vertrag") the link to the overriding breadcrumb is collapsed and there's a dropdown-field. By changing the word from "Vertrag" to "Vertrags", the overriding breadcrumb isn't collapsed anymore.
Can you help me, to disaple this dropdown-field?
XML-file containing the breadcrumb:
<FlexBox height="50px" alignItems="Start" justifyContent="Center">
<Breadcrumbs currentLocationText="{i18n>Contract}">
<Link press="onPressBreadcrumb" text="{i18n>Overview}" id="Overview"/>
</Breadcrumbs>
</FlexBox>
OK
Not OK
Thanks.
I think, this must be a issue on calculation width of the flex box. Try to play with margins, pattern or other stuff that affect rendering.
Or try to force for test like this
<FlexBox height="50px" alignItems="Start" justifyContent="Center">
<Breadcrumbs currentLocationText="{i18n>Contract}">
<Link press="onPressBreadcrumb" text="{i18n>Overview}" id="Overview"/>
</Breadcrumbs>
<Label text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" />
</FlexBox>
It may be necessary to test it on all popular browsers.

How do I deactivate Bootstrap-wysihtml5 jquery editor instance?

I'm using the Bootstrap-wysihtml5 jquery plugin (https://github.com/jhollingworth/bootstrap-wysihtml5/) to convert textareas to WYSIWYG. I would like to be able to activate and deactivate the editor by clicking on 2 buttons, so far i can show the editor, please will you let me know how i can deactivate the editor and leave just the textarea and its value. My code is as follows:-
HTML
<textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
<input type="button" id="button1" value="Show Editor">
<input type="button" id="button2" value="Hide Editor">
Script
$("#button1").click(function(){
$('textarea').wysihtml5();
});
$("#button2").click(function(){
// this is where i'm stuck
});
Thank you
A few lines of custom JS code. I think they can help you.
var content = $('#content');
var contentPar = content.parent()
contentPar.find('.wysihtml5-toolbar').remove()
contentPar.find('iframe').remove()
contentPar.find('input[name*="wysihtml5"]').remove()
content.show()
I had the same problem trying to disable/hide the toolbar and editor and had luck with the following commands (to disable the editor). I'm using version wysihtml5-0.3.0_rc2.js)
$('#editorId').data('wysihtml5').editor.composer.disable();
$('#editorId').data('wysihtml5').editor.composer.enable();
or (to hide the editor)
$('#editorId').data('wysihtml5').editor.composer.hide();
$('#editorId').data('wysihtml5').editor.composer.show();
To do the same to the toolbar you do the following to hide/show (can't find a wat to disable the toolbar):
$('#editorId').data('wysihtml5').editor.toolbar.hide();
$('#editorId').data('wysihtml5').editor.toolbar.show();

How to show a cq5 form page in a overlay

I have the code below to show a button in a overlay.
<div class="overlay22" id="overlay22" style="display:none;"></div>
<div class="box22" id="box22">
<input type="submit" value="Submit" class="buttonclick" id="buttonclick" />
</div>
Can we show the cq5 form in the overlay instead of hardcoding in the overlay?
If you are just creating some sort of basic form template or component, I think you should just stick to using regular HTML elements and then control look + feel with CSS. Though if you absolutely needed to use form elements similar to what you see in CQ's dialog windows, you will need to generate them by working with CQ's extension of the Ext JS framework.
For example, if you wanted to create a button analogous to your provided example, you'd have to write something like:
CQ.Ext.onReady( function(){
var button = new CQ.Ext.Button({
text : "Submit",
id : "buttonclick",
cls : "buttonclick",
renderTo : CQ.Ext.getBody(),
listerners : {
click : function(){
// Write handler code here
}
}
});
});
Widget API for latest version of CQ (5.5):
http://dev.day.com/docs/en/cq/current/widgets-api/index.html
Materials on Sencha Ext JS 3.4 (which I believe 5.5 is built on):
http://docs.sencha.com/ext-js/3-4/
We can do in the following way as well,
Say for instance we have a page with default cq5 form component already dragged in that,
Let that page be defined in this path as /content/geometrix/loginpage.html
Now we can show the above page in an overlay, using the below code
<div class="overlay22" id="overlay22" style="display:none;"></div>
<div class="box22" id="box22">
<sling:include path="content/geometrix/loginpage/par" />
</div>
Below that par we can find the contents of the form.Here box22 is the lightbox(pop up) and the overlay22 is the background div