bryanhunt / ember-split-view Goto Github PK
View Code? Open in Web Editor NEWEmberJS SplitView
License: MIT License
EmberJS SplitView
License: MIT License
Currently it doesn't work if jQuery
is disabled.
It appears to use this.$()
instead of this.element
in a few places.
For the simplest requirements - a few rows and columns only, no need for scrolling
When elements are placed on top of the individual child views, the views lose both their relative positions and sizes.
This addon is very lacking in the unit test department.
The split-view component test fails at:
_setStyle: function() {
var style = this.get('element').style;
this.get('element')
is returning null. This comes from:
Ember.run.next(this, function() {
this._setStyle();
});
I don't understand yet why the element is null. _setStyle()
is called prior to this and the element is not null. I see the same call stacks in the dummy app, but element is never null.
The dummy app is throwing content security policy violations again.
observers are low level concepts, writing straight to the DOM at this point and time can result in many wasteful draws/writes and also make your view prone to race conditions.
Utilizing a bindableAttribute to bind style attribute directly with the needed dimensions will result in a much better experience as it lets embers binding system and rendering system do the work only once and at a much more optimal time.
I've got this setup:
{{#split-view isVertical=true splitPosition=initialVerticalSplit}}
{{#split-child}}
{{#split-view isVertical=false splitPosition=initialHorizontalSplit }}
{{#split-child}}
<div></div>
{{/split-child}}
{{split-sash}}
{{#split-child}}
<div></div>
{{/split-child}}
{{/split-view}}
{{/split-child}}
{{split-sash}}
{{#split-child}}
<div></div>
{{/split-child}}
{{/split-view}}
So, basically two columns, with the first having two rows. When I resize the window horizontally (or diagonally), all panes get resized correctly. However, when I resize vertically, the bottom of the top row on the left column moves too far up, becoming separated from the sash and bottom row which stay fixed to the bottom of the window.
When I then resize the window horizontally, the bottom of the top row on the left column snaps back into position at the top of the sash.
Has anyone had this issue? I tried making a JSBin but am not sure how to add ember-split-view as a component.
Tried using ember-split-view with Ember 1.7.0-beta5 last night but kept getting errors. The error was in the SplitViewChild#updateMovableSide because movableSide was null. I tracked this back to changes between beta 1 and 2.
Pre beta 2, SplitViewComponent#updateOrientation sets movableSide. After beta 2 this doesn't get called as SplitSashComponent#didInsertElement changes its parentView.sash attribute which triggers SplitView#constrainSplit. SplitView#constrainSplit subsequently changes splitPercentage which is aliased to SplitChildComponent#splitPercentage and triggers SplitViewChild#updateMovableSide without calling updateOrientation to set movableSide.
After discussion with rwjblue on IRC it seems this change in behaviour is because ember now lazily evaluates aliases.
Heres a rough trace for both versions using console.log statements.
Pre beta 2:
SplitViewComponent#didInsertElement
SplitChildComponent#didInsertElement
SplitViewComponent#addChildView
SplitSashComponent#didInsertElement
SplitViewComponent#constrainSplit
SplitSashComponent#updateWidth
SplitChildComponent#didInsertElement
SplitViewComponent#addChildView
SplitViewComponent#updateOrientation - this sets movableSide
SplitViewChild#updateMovableSide
SplitViewChild#updateMovableSide
Beta 2 and after:
SplitViewComponent#didInsertElement
SplitChildComponent#didInsertElement
SplitViewComponent#addChildView
SplitSashComponent#didInsertElement
SplitView#constrainSplit
SplitViewChild#updateMovableSide
Haven't really had chance to look at how this can be fixed yet.
Update the code to support EmberJS 2.0.
loader.js:247 Uncaught Error: Could not find module `ember` imported from `ember-resize/services/resize`
at missingModule (loader.js:247)
at findModule (loader.js:258)
at Module.findDeps (loader.js:168)
at findModule (loader.js:262)
at Module.findDeps (loader.js:168)
at findModule (loader.js:262)
at requireModule (loader.js:24)
at resolveInitializer (index.js:34)
at registerInitializers (index.js:47)
at exports.default (index.js:28)
...
Uncaught TypeError: Cannot read property 'listeners' of undefined
at window.onerror
...
Show an ember split view
In Chrome, show the debugger window (F12)
Split view correctly shrinks to fill above the debugger window
Close the debugger
Split view does not expand to fit
Can anyone else confirm this bug?
how do I build your nice project?
I'm hitting this bug when running the demo app
It's been fixed, so best to upgrade ember-cli in your demo app and in the addon
I've upgraded Ember in the ember-2.14 branch. The sash is not displayed between the child views. I'm guessing it is a problem with the flex layout in the dummy test app. If anyone has time to look at this, help would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.