This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App side | |
import React, { useEffect, useRef, SyntheticEvent } from "react" | |
type IframePropsType = { | |
src: string | |
} | |
export default ({ src }: IframePropsType) => { | |
const el = useRef<HTMLIFrameElement>(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage: | |
* <PopoverStickOnHover | |
* component={<div>Holy guacamole! I'm Sticky.</div>} | |
* placement="top" | |
* onMouseEnter={() => { }} | |
* delay={200} | |
* > | |
* <div>Show the sticky tooltip</div> | |
* </PopoverStickOnHover> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseUploader < CarrierWave::Uploader::Base | |
attr_reader :width, :height | |
before :cache, :capture_size | |
... | |
# for image size validation | |
# fetching dimensions in uploader, validating it in model | |
def capture_size(file) | |
if version_name.blank? # Only do this once, to the original version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Colorbox Core Style: | |
The following CSS is consistent between example themes and should not be altered. | |
*/ | |
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} | |
#cboxWrapper {max-width:none;} | |
#cboxOverlay{position:fixed; width:100%; height:100%;} | |
#cboxMiddleLeft, #cboxBottomLeft{clear:left;} | |
#cboxContent{position:relative;} | |
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must init the multiple select with $('#your-select').multiSelect() before calling one of the following methods | |
$('#your-select').multiSelect('select', 'value'); // Select the item with the value given in parameter | |
$('#your-select').multiSelect('deselect', 'value'); // Deselect the item with the value given in parameter | |
$('#your-select').multiSelect('select_all', true); // Select all elements. If parameter visible set to true, it will select only visible items. Otherwise it will also select hidden items | |
$('#your-select').multiSelect('deselect_all'); // Deselect all items previously selected | |
$('#your-select').multiSelect('refresh'); // Re-in the multiselect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must init the multiple select with $('#your-select').multiSelect() before calling one of the following methods | |
$('#your-select').multiSelect('select', 'value'); // Select the item with the value given in parameter | |
$('#your-select').multiSelect('deselect', 'value'); // Deselect the item with the value given in parameter | |
$('#your-select').multiSelect('select_all', true); // Select all elements. If parameter visible set to true, it will select only visible items. Otherwise it will also select hidden items | |
$('#your-select').multiSelect('deselect_all'); // Deselect all items previously selected | |
$('#your-select').multiSelect('refresh'); // Refresh current multiselect. It will re-init the multiselect based on the <select> element (useful for when select is update through Ajax) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must init the multiple select with $('#your-select').multiSelect() before calling one of the following methods | |
$('#your-select').multiSelect('select', 'value'); // Select the item with the value given in parameter | |
$('#your-select').multiSelect('deselect', 'value'); // Deselect the item with the value given in parameter | |
$('#your-select').multiSelect('select_all', true); // Select all elements. If parameter visible set to true, it will select only visible items. Otherwise it will also select hidden items | |
$('#your-select').multiSelect('deselect_all'); // Deselect all items previously selected | |
$('#your-select').multiSelect('refresh'); // Refresh current multiselect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must init the multiple select with $('#my-select').multiSelect() before calling one of the following methods | |
$('#countries').multiSelect('select', 'value'); // Select the item with the value given in parameter | |
$('#countries').multiSelect('deselect', 'value'); // Deselect the item with the value given in parameter | |
$('#countries').multiSelect('select_all', true); // Select all elements. If parameter visible set to true, it will select only visible items. Otherwise it will also select hidden items. | |
$('#countries').multiSelect('deselect_all'); // Deselect all items previously selected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select multiple="multiple" id="countries" name="countries[]"> | |
<option value="fr">France</option> | |
<option value="uk">United Kingdom</option> | |
<option value="us">United States</option> | |
<option value="ch">China</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#countries').multiSelect({ | |
afterSelect: function(value, text){}, // Function to call after one item is selected | |
afterDeselect: function(value, text){}, // Function to call after one item is deselected | |
selectableHeader: null, // Text or HTML to display on the selectable container | |
selectedHeader: null, // Text or HTML to display on the selected container | |
disabledClass: 'disabled' // CSS class for disabled items | |
}); |
NewerOlder