How refresh Flickity plugin? - plugins

I have a problem with Flickity plugin. I want to use this one mixed with svgLoader plugin. The slider animation does't work correctly because you need to resize the window for refresh flickity plugin.
You can try it here : http://thibaut-lalanne.com/
Thx

You can manually refresh the slider anytime.
yourFlickitySlider.resize();

Resize the carousel and re-position cells like so:
// jQuery
var $carousel = $('.carousel').flickity()
$carousel.flickity('resize')
// vanilla JS
var flkty = new Flickity('.carousel');
flkty.resize()
For examples see: https://flickity.metafizzy.co/api.html#resize

Related

ag-grid context menu is cut off (clipped)

Having a ag-grid (Angular component) of ag-grid v8.20
Unfortunately the context menu is clipped if it is bigger than the grid:
(screenshot should be here but I can't upload it, imgur bug?)
Is there a way to make the context menu display completely, without clipping?
If anyone else comes across this post, here is a plunker to demonstrate the fix.
var gridOptions = {
...
popupParent: document.querySelector("body")
...
};
It was clipped because of a CSS style I set on my component.
In my case it was a flexbox with "overflow-y: auto".
I had to remove that to make it work.
This is a general answer for people facing the same issue in react and typescript. This works for me.
popupParent={document.querySelector('body') || undefined}

How to create a custom settings control in Leaflet

I would like to add a custom container to Leaflet. The container would contain edit controls and would be used as a kind of properties editor in order to customize the map (marker colors, zoom level, polyline color, etc ...). The panel would be displayed when the user clicks on a "settings" button located on the map.
Is there a Leaflet plugin for this?
I also had a look at how to implement custom controls, but I am really not clear how to achieve this. In particular it seems to me that I can only use JavaScript and DOM manipulations (and no direct HTML markup) in order to create a custom control.
Could someone please help me bootstrap the control? thanks!
Edit:
So I tried to create a very simple container consisting of a single checkbox "control" as follow:
L.Control.SettingsPanel = L.Control.extend({
onAdd: function(map){
var checkbox = L.DomUtil.create('input');
checkbox.setAttribute("type", "checkbox");
checkbox.style.width = '200px';
return checkbox;
}
});
L.control.settingsPanel = function(opts){
return new L.Control.SettingsPanel(opts);
}
The sidebar v2 leaflet plugin might be what you are looking for.

Protractor cannot select element on overlay

I'm having trouble locating elements on an overlay. I've tried locating via by.id and it still doesn't find the element. I tried element(by.id('some-element'));
I'm not sure how this overlay is generated but it does go underneath a header menu on top of the page when you scroll. Not sure if that'll help any. Its not an iframe.
One more thing. Its a drupal app and specifically on the add user overlay. I think there something special going on there. Can someone see if they have the same issue?
Any help would be appreciated. Thanks.
Since the overlay is inside an iframe, you first need to switch to it's context:
// wait for the frame to be present
var EC = protractor.ExpectedConditions;
var iframe = $("iframe.overlay-active");
browser.wait(EC.presenceOf(iframe), 5000);
// switch to the iframe
browser.switchTo().frame(iframe);
// do something
// get back to the main context
browser.switchTo().defaultContent();

changing the image of a draw2d button after creation

I am writing an eclipse plugin using draw2d. I am creating a draw2d button using the constructor : Button(Image image). At some point I want to change the image on that button! I can not find a way of doing it. Can anyone help me please?
Kind Regards,
Kyriakos
You could do the following:
Button button = ...
Image newImage = ...
((Label) button.getChildren().get(0)).setIcon(newImage);
It's certainly not nice, but it seems to be the only option.
Can't be done. The function that sets the image on the button is Clickable.setContents, which is protected. There is nothing in the documentation telling why this was done... You can try to inherit from Button and adding a new function to implement this.

How do you programatically remove (not disable) a button from TinyMCE?

I can disable the table button using this:
tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)
but what I'm interested in is actually hiding it. Any idea on how to accomplish that?
Thank you!
First, you have to use the advanced theme.
Then, add this option in the TinyMCE init code.
tinyMCE.init({
...
theme_advanced_disable : "bold, justifyleft, justifyright"
});
I hope this might help someone.
source
list of elements' name here
I'm not familiar with TinyMCE myself, but since you appear to have javascript access to the element itself, all you need to do is set it's display property to "none".
document.getElementById("theButton").style.display = "none";
incase ur trying to hide a specific button, use the following code.
$('.mce_cut').hide() //hides cut button
lookup other button titles using firebug in case u wish to hide something specific.
Incase you are looking to hide specific editor's button, modifiy the jquery selector to select correct sibling/descendent.
alternately, try this ..
tinyMCE.activeEditor.controlManager.controls.ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords_cut.remove()
Note that ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords is my asp.net control's id. Don't bother about this if ur not using Asp.net serverside textbox control. In case you are.. <% theTextBoxID.ClientID %> gets u that.
Use the following (using jQuery; a non-jQuery approch is easily built):
var elem = $(ed.id+'_'+'divId_table')
elem.addClass('mceButtonDisabled');
elem.removeClass('mceButtonEnabled');