Skip to content

Instantly share code, notes, and snippets.

closeModal: function() {
var fw7 = new Framework7();
Ember.$(document).click(function(e) {
var panel = Ember.$('.container-sidebar');
var elementClicked = Ember.$(e.target);
var clickIn = Ember.$.contains(panel[0], e.target);
if (!clickIn && !elementClicked.hasClass('close-sidebar')) {
fw7.closePanel();
}
npm i Atlantis-Software/waterline#deepPopulate
USE:
Father.find()
.populate('child.grandchild')
http://stackoverflow.com/questions/23446484/sails-js-populate-nested-associations
STEPS:
1 CREATE PROJECT:
1.1 -> ember new project-name
2 PODS:
2.1 -> In config/environment add this line podModulePrefix: 'project-name/pods',
2.2 -> ember generate route application --pod
2.3 -> read more in http://ember-cli.com/user-guide/
/******************************** Custom Post contact ****************************/
function custom_post_contact() {
$labels = array(
'name' => _x( 'contacts', 'post type general name' ),
'singular_name' => _x( 'contact', 'post type singular name' ),
'add_new' => _x( 'Adicionar Nova contact', 'contact' ),
'add_new_item' => __( 'Nova contact' ),
'edit_item' => __( 'Editar contact' ),
'new_item' => __( 'Nova contact' ),
'all_items' => __( 'Todas as contacts' ),
JQUERY LIB:
https://raw.githubusercontent.com/cdnjs/cdnjs/master/ajax/libs/jquery.inputmask/3.1.49/jquery.inputmask.bundle.min.js
HTML:
<input type="text" placeholder="Telefone*" name="telefone" class="input-phone" required>
CODE JS:
jQuery(".input-phone").inputmask({
mask: ['(99) 9999-9999', '(99) 99999-9999'],
keepStatic: true,
arquivo javascript
//code ajax of loading feed of facebook
var skipFb = 0;
$('.button-feed-fb').click(function(e) {
var idFeedFb = e.target.id;
if (idFeedFb === 'prev-feed-fb') {
if (skipFb > 0) {
sass --watch input.scss:output.css
$(document).scroll(function() {
var top = document.body.scrollTop;
var maxTop = document.body.scrollHeight - document.body.clientHeight;
if (parseInt(top) === maxTop) {
console.log('Chegou ao fim da página')
}
});