Skip to content

Instantly share code, notes, and snippets.

View swarnendude's full-sized avatar

Swarnendu De swarnendude

View GitHub Profile
@swarnendude
swarnendude / gist:5636294
Created May 23, 2013 14:03
showActiveItem
// Add these properties and the method in your Utility class
// Type of animation
animationType : 'slide',
// Default animation duration is 250ms. You can change it here
animationDuration : 100,
// Turn ON or OFF the transitions
enablePageAnimations : true,
@swarnendude
swarnendude / gist:5636124
Last active December 17, 2015 16:08
Simple dataview with tpl
var touchTeam = Ext.create('Ext.DataView', {
store: 'MyStore',
itemTpl: document.getElementById('tpl_sales_rep_input').innerHTML
});
@swarnendude
swarnendude / gist:5636039
Last active December 17, 2015 16:00
Template inside index.html
<!-- Sales Rep TPL Info -->
<script type="text/template" id="tpl_sales_rep_info">
<div class="black-box sales-rep-details" id="sales_rep_info_block">
<div class="name">{name}</div>
<div><a href="tel:{phone}">{phone}</a></div>
<div><a href="mailto:{email}">{email}</a></div>
</div>
</script>
<!-- Sales Rep TPL Input -->
@swarnendude
swarnendude / gist:5635696
Last active December 17, 2015 15:59
api function
// A self executing function to return an object with all the api urls
api: (function () {
// This is the base API url
var baseUrl = 'http://www.example.com/api/';
return {
baseUrl: baseUrl,
categories: baseUrl + 'categories',
about: baseUrl + 'about'
}
@swarnendude
swarnendude / gist:5635666
Last active December 17, 2015 15:59
Utility class
Ext.define('App.util.Utility', {
singleton: true
// Other properties and methods here
});
@swarnendude
swarnendude / gist:5481644
Last active December 16, 2015 18:59
Slidenav - CSS for top navigation
/* For top navigation */
.slide,
.nav-list {
-webkit-animation-duration: .200s;
-webkit-transition-timing-function: cubic-bezier(0.275, 0.080, 0.425, 0.855);
}
.slide {
@swarnendude
swarnendude / gist:5481532
Last active December 16, 2015 18:59
Slidenav - CSS for right navigation
/* For right side navigation */
.slide ,
.nav-list {
-webkit-animation-duration: .200s;
-webkit-transition-timing-function: cubic-bezier(0.275, 0.080, 0.425, 0.855);
}
.slide {
background: #f1f1f1;
@swarnendude
swarnendude / gist:5481361
Last active December 16, 2015 18:59
Slidenav - controller
Ext.define('SlideNav.controller.App', {
extend: 'Ext.app.Controller',
config: {
refs: {
main: 'main',
navigation: 'navigation',
navBtn: 'button[name="nav_btn"]'
},
@swarnendude
swarnendude / gist:5481067
Last active December 16, 2015 18:50
Slidenav - CSS for left navigation
/* For left side navigation */
.slide ,
.nav-list {
-webkit-animation-duration: .200s;
-webkit-transition-timing-function: cubic-bezier(0.275, 0.080, 0.425, 0.855);
}
.slide {
background: #f1f1f1;
@swarnendude
swarnendude / gist:5480899
Last active December 16, 2015 18:49
Viewport for both left and right navigation
Ext.define('SlideNav.view.Viewport', {
extend: 'Ext.Container',
xtype: 'app_viewport',
requires: [
'Ext.TitleBar'
],
config: {
fullscreen: true,
layout: 'hbox',
items: [{