Skip to content

Instantly share code, notes, and snippets.

View pguerrant's full-sized avatar

Philip Guerrant pguerrant

  • Sencha, Inc.
  • Colorado, USA
View GitHub Profile
@pguerrant
pguerrant / scroll-snap.html
Created July 19, 2016 14:16
Scroll Snapping
<!DOCTYPE html>
<html>
<head>
<title>Scroll Snap Demo</title>
</head>
<body>
<style>
body {
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
]
});
// Create the combo box, attached to the states data store
@pguerrant
pguerrant / gist:7379973
Created November 9, 2013 00:47
Initialization of hasListeners object on class prototypes
Ext.define('Observable', {
hasListeners: {},
observableType: 'observable',
onClassMixedIn: function(Class) {
var prototype = Class.prototype;
if (prototype.hasOwnProperty('observableType')) {
prototype.hasListeners = {};
}
@pguerrant
pguerrant / gist:7327683
Created November 5, 2013 22:44
Steps to create easy-button
sencha generate package easy-button
modfy the sass namespace in its sencha.cfg:
package.sass.namespace=EasyButton
Add the package.framework property to sencha.cfg:
package.framework=ext
add package.theme so that we can build the package independently of an app:
package.theme=ext-theme-neptune
@pguerrant
pguerrant / gist:7327036
Created November 5, 2013 21:55
stack trace - easy-buttton slice
[DBG] Generating image content for easy-button/images/btn/btn-easy-default-small-corners.gif
[ERR]
[ERR] BUILD FAILED
[ERR] java.lang.IllegalArgumentException: Incompatible image type and IndexColorModel
[ERR] at java.awt.image.BufferedImage.<init>(BufferedImage.java:565)
[ERR] at com.sencha.tools.slicer.Quantizer.quantize(Quantizer.java:172)
[ERR] at com.sencha.tools.slicer.Quantizer.quantize(Quantizer.java:77)
[ERR] at com.sencha.tools.slicer.Operation$DefaultWriter.save(Operation.java:74)
[ERR] at com.sencha.tools.slicer.operations.BasicOperation.perform(BasicOperation.java:41)
[ERR] at com.sencha.tools.slicer.Model$Slice.perform(Model.java:651)
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<style>
div {
display: inline-block;
width: 30px;
height: 30px;
@pguerrant
pguerrant / gist:5034141
Created February 25, 2013 23:02
body border management
@if $ui-include-border-management-rules {
.#{$prefix}panel-#{$ui-label} {
.#{$prefix}dock-outer-border-l {
border-left-color: $ui-border-color !important;
border-left-width: $ui-border-width !important;
}
.#{$prefix}dock-outer-border-b {
border-bottom-color: $ui-border-color !important;
border-bottom-width: $ui-border-width !important;
}
@pguerrant
pguerrant / gist:4666558
Last active December 16, 2017 19:20
Webkit border-collapse bug. Table is missing bottom border if it has border-collapse: collapse, box-sizing:border-box, overflow:hidden and is absolutely positioned
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<style>
table {
border-collapse: collapse;
border-spacing: 0;
@pguerrant
pguerrant / gist:3954089
Created October 25, 2012 17:12
Overriding an override
Ext.define('A', {
foo: function() {
console.log('A Foo');
}
});
Ext.define('B', {
override: 'A',
foo: function() {
console.log('B Foo');
@pguerrant
pguerrant / gist:3933570
Created October 22, 2012 19:34
Rtl Ext.view.Table override
Ext.define('Ext.rtl.view.Table', {
override: 'Ext.view.Table',
rtlCellTpl: [
'<td class="' + Ext.baseCSSPrefix + 'rtl {tdCls}" {tdAttr}>',
'<div {unselectableAttr} class="' + Ext.baseCSSPrefix + 'rtl ' + Ext.baseCSSPrefix + 'grid-cell-inner" style="text-align: {align}; {style};">{value}</div>',
'</td>',
{
priority: 0
}