I use 'tabs' for my resource in ActiveAdmin page.
Something like this:
tabs do
tab 'General' do
end
tab 'Content' do
end
end
Have AA ability for set not first tab as active?
Something like:
tab 'Content', active: true
I've figured out that ActiveAdmin doesn't support this out of the box:
JS code for tabs otherwise can set active tab accordingly css class ui-tabs-active but has not ability for passes css class to html.
I've prepared push-request for adding this ability:
https://github.com/activeadmin/activeadmin/pull/5411'
This allows make next:
tab 'Content', {class: 'ui-tabs-active'} do
#omitted code
end
and tab content will be active when page loading.
Related
I'm developing tabs component and I want Angular to render and initialize only active tab instead of all tabs. How can it be done?
<my-tabs>
<my-tab [tabTitle]="'Tab1'">
<some-component></some-component>
</my-tab>
<my-tab [tabTitle]="'Tab2'">
<some-component2></some-component2>
</my-tabs>
Basicaly In this case the first tub is active, so <some-component></some-component> should be initialized, but <some-component2></some-component2> shouldn't as Tab2 is not active
Use *ngIf on the component. When the value if false, the component will be removed from the DOM, and therefore not initialised. Something roughly like:
<my-tab [tabTitle]="'Tab1'">
<some-component *ngIf="tabOneActive" ></some-component>
</my-tab>
I want to create a new tabbed panel for the Dojo tab container using CSJS like:
dijit.byId('#{id:djTabContainer1}').createTab({ tabTitle: Math.random()});
The default tab panel has an panel that will use the iframe tag and I want to pass in the above call the src html attribute to the panel.
Question : I can specify a url to load in the iframe. Is there a way to pass this?
It seems like the createTab only does certain tab related parameters like action and tabTitle.
Howard
The syntax is somewhat obscure here. Starting with the code in the ExtLib demo app:
XPagesExt.nsf/Core_DynamicTabs.xsp
Change the script in button4 to:
dijit.byId('#{id:djTabContainer1}')
.createTab({
"newName":'Tab'+Math.random(),
"newHref":'/XPagesExt.nsf/page5.xsp'})
to match the syntax you're requesting.
And, in the tab that's referenced by defaultTabContent, change the title and href to use those passed URL parameters:
<xe:djTabPane xp:key="doc" id="djTabPane2"
title="${javascript:/*load-time-compute*/param.newName}"
href="${javascript:/*load-time-compute*/param.newHref}"
It will create the tab and will attempt to load the href contents. I'm not seeing it as an iframe though - it's just a container div.
My current code is:
= link_to 'Compare Schools', '#', class: 'btn-default'
I want to essentially link back to the top of the page. To do so in regular html I would link to a div at the top of the page (in this case div="header-wrapper"), which would make the code:
= link_to 'Compare Schools', '.section-wrapper', class: 'btn-default'
This however gives me an error message No route matches [GET] "/.section-wrapper" when I click on the button.
Remember that links need to be to separate pages, or within the page. If prefixed with the anchor indicator # it's presumed to be an anchor destination. Those are typically made like this:
%a{ name: 'anchor_name' }
Then you can link to this:
= link_to('Link', '#anchor_name')
If you try and link to a CSS selector, it's going to be interpreted as a relative URL and it won't work.
Someone was able to so quickly help me with a problem I'd spent hours and hours on, that I'm hoping I'll get lucky and someone can point me in the right direction on this one, too.
I didn't see anyone else with quite my issue here - and I'm new to working with WP templates instead of plain old HTML/CSS/JS stuff.
Basically - on a site we did (www.opted.org) with a purchased WP theme - I can't get the mobile version collapsible menu to stop defaulting on page load to the last item in the Main Menu.
So instead of something that makes sense - like About ASCO, or even being able to add "Select Page" - the drop down shows "-- past issues"
I don't care how I fix it really, but the client just doesn't want that page to be the default. I tried adding an extra menu item at the end called "Select Page" with an href='#' and using CSS to hide it on screens above 480px - but I couldn't get it to work no matter how I tried to refer to it.
I feel like this should be easy - but I don't know where to set the selected LI among the many WP files.
Thanks!!
I had a look at the plugin.js file on the site www.opted.org.
On line 22, there is 'header' : false // Boolean: Show header instead of the active item
and on line 41 there is jQuery('<option/>').text('Navigation')
Try setting line 22 to true, and text('Navigation') to your 'Select Page' if you prefer that over the text 'Navigation'
Or, according to the tinynav.js page (http://tinynav.viljamis.com/), you can customize that as an option like this:
$("#nav").tinyNav({
active: 'selected', // String: Set the "active" class
header: 'Navigation', // String: Specify text for "header" and show header instead of the active item
label: '' // String: Sets the <label> text for the <select> (if not set, no label will be added)
});
In your main.js file, your calling it on line 14. You should add that header: 'Navigation', option there.
It's hard to answer this question without knowing how the theme you are using works. However, you can certainly change the selected attribute using javascript.
Here's the code you would use to set it to 'About Asco' using jQuery:
jQuery('.tinynav').val('/about-asco/')
alternatively (a little clearer, but more verbose):
jQuery('.tinynav option:first').prop('selected', true);
I have a popup window containing a form which gathers data for a report.
When I click submit in that window, I want it to close the popup, and open the report in the original window that called the popup.
I think I can open the report in the correct window by using
{ :target => <name of window> }
in the form_tag, but I don't know how to determine or set the name of the originating window.
I also don't know how to close the popup window.
:target => adds the html attribute target to the link. This opens up a new window and names the new window the target.
You have to use javascript or Ajax to redirect the old page,
window.opener.location.href="http://new_url";
and then close the old window.
window.close();
This can be done either through the rjs file or directly in the javascript.
The popup window can be closed using the onClick html event as follows:
<%= submit_tag "Go!", {:onClick => "window.close()"} %>
Try this:
function fclosepopup(){
window.opener.location.replace="URL";
window.close();
}
It will close the current window and bring you to the next page in the parent window.
How is this for starters?
# The submit button in your child window's view:
<%= button_to_function 'Save', "$('my_form').submit(); window.opener.location.reload(); window.close();" %>