Created
June 1, 2017 22:53
-
-
Save RustyToms/e30d04f1e3e1f4cdb3f95749dbeb3f6c to your computer and use it in GitHub Desktop.
New Twiddle
This file contains hidden or 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
import Ember from 'ember'; | |
import Table from 'ember-light-table'; | |
const { computed, Component, get, set } = Ember; | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); | |
set(this, 'table', new Table(get(this, 'columns'), get(this, 'model'))); | |
Ember.getOwner(this).lookup("component:light-table/columns/base").constructor.prototype.dragOver = function(e) { | |
this._super(...arguments); | |
if (this.get('isDropTarget')) { | |
e.preventDefault(); | |
if (!this.get('isDragTarget')) { | |
this.set('isDragTarget', !this.$().hasClass('is-dragging')); | |
} | |
} | |
} | |
} | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
columns: [{ | |
label: 'foo', | |
resizable: true, | |
draggable: true, | |
valuePath: 'foo', | |
width: '100px' | |
}, { | |
label: 'bar', | |
resizable: true, | |
draggable: true, | |
valuePath: 'bar', | |
width: '100px' | |
}, { | |
label: 'baz', | |
resizable: true, | |
draggable: true, | |
valuePath: 'baz', | |
width: '100px' | |
}, { | |
label: 'other', | |
resizable: true, | |
draggable: true, | |
valuePath: 'baz', | |
width: '100px' | |
}, { | |
label: 'new', | |
resizable: true, | |
draggable: true, | |
valuePath: 'baz', | |
width: '100px' | |
}, { | |
label: 'address', | |
resizable: true, | |
draggable: true, | |
valuePath: 'address' | |
}], | |
model: [ | |
{foo: 123, bar: 321, baz:"test", address: "000 Balistreri Centers Suite 27" }, | |
{foo: 123, bar: 321, baz:"test", address: "000 Balistreri Centers Suite 272" }, | |
{foo: 123, bar: 321, baz:"test", address: "000 Balistreri Centers Suite 272" }, | |
{foo: 123, bar: 321, baz:"test", address: "000 Balistreri Centers Suite 272" }, | |
{foo: 123, bar: 321, baz:"test", address: "000 Balistreri Centers Suite 272" }, | |
{foo: 123, bar: 321, baz:"test", address: "000 Balistreri Centers Suite 272" } | |
] | |
}); |
This file contains hidden or 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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.lt-column { | |
font-weight: 700; | |
padding: 10px 8px; | |
height: 43.5px; | |
border-bottom: 2px solid #111; | |
border-right: 1px solid #111; | |
} | |
.lt-column.is-drag-target::after { | |
position: absolute; | |
top: 0; | |
background-color: red; | |
content: ''; | |
width: 2px; | |
height: 100%; | |
z-index: 2; | |
} | |
.lt-column.drag-right::after { | |
right: -1px; | |
} | |
.lt-column.drag-left::after { | |
left: -1px; | |
} | |
.lt-cell { | |
position: relative; | |
padding: 10px 8px; | |
color: #222; | |
border-right: 1px solid #111; | |
height: 43.5px; | |
} |
This file contains hidden or 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
{ | |
"version": "0.11.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0" | |
}, | |
"addons": { | |
"ember-light-table": "1.8.6" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment