From e17b8dc1c70677da221d76b5e5786be7386dedf1 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:36:16 -0800 Subject: [PATCH 01/13] FlexSplit: Constants and main entry object for Flex --- lib/components/flexsplit/flex.coffee | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/components/flexsplit/flex.coffee diff --git a/lib/components/flexsplit/flex.coffee b/lib/components/flexsplit/flex.coffee new file mode 100644 index 00000000..2399b24c --- /dev/null +++ b/lib/components/flexsplit/flex.coffee @@ -0,0 +1,26 @@ +module.exports = + + INSTANCE_TYPE : 'KDFlexSplit' + + EVENT_HIDE : 'KDFlexSplit.HIDE' + EVENT_RESIZE : 'KDFlexSplit.RESIZE' + EVENT_EXPAND : 'KDFlexSplit.EXPAND' + EVENT_COLLAPSE : 'KDFlexSplit.COLLAPSE' + + EVENT_HIDDEN : 'KDFlexSplit.HIDDEN' + EVENT_RESIZED : 'KDFlexSplit.RESIZED' + EVENT_EXPANDED : 'KDFlexSplit.EXPANDED' + EVENT_COLLAPSED : 'KDFlexSplit.COLLAPSED' + + MAX : 100 + MIN : 0.0001 + + HORIZONTAL : + name : 'horizontal' + axis : 'y' + getter : 'getHeight' + + VERTICAL : + name : 'vertical' + axis : 'x' + getter : 'getWidth' From 9f0a15f181efd8ed8809ee7fd79773651daee3b6 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:36:57 -0800 Subject: [PATCH 02/13] FlexSplit: FlexResizer initial commit --- lib/components/flexsplit/flexresizer.coffee | 187 ++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 lib/components/flexsplit/flexresizer.coffee diff --git a/lib/components/flexsplit/flexresizer.coffee b/lib/components/flexsplit/flexresizer.coffee new file mode 100644 index 00000000..55d8afd5 --- /dev/null +++ b/lib/components/flexsplit/flexresizer.coffee @@ -0,0 +1,187 @@ +KDFlex = require './flex' +KDView = require '../../core/view' + + +module.exports = class KDFlexSplitResizer extends KDView + + + constructor: (options = {}, data) -> + + options.type ?= KDFlex.HORIZONTAL + options.cssClass = 'flex-resizer' + options.draggable = { axis: options.type.axis } + + super options, data + + @views = [] + @_fractions = [] + { @type, view } = @getOptions() + + @addView view + + @on 'DragFinished', @dragFinished + @on 'DragStarted', @dragStarted + + + _getViewIndex: (view) -> + if view is @views[0] then 0 else 1 + + + addView: (view) -> + + @views.push view + + # This will handle expand request of the view, it will set fraction + # as KDFlex.MAX for requested view and will do KDFlex.MIN for other view + # it will also fire the same event which will cause a chain reaction + # on parent resizers to do same. It will allow us to expand nested + # views up to the parent one ~ GG + view.on KDFlex.EVENT_EXPAND, => + + return if view.hasClass 'expanded' + view.setClass 'expanded' + + # This will start chain reaction for expanding parent views + @emit KDFlex.EVENT_EXPAND + + @_updateViewSizes() + @_updateFractions 0, set = no + + fractions = [] + viewIndex = @_getViewIndex view + for i in [0..1] + fractions.push if i is viewIndex then KDFlex.MAX else KDFlex.MIN + @_setViewFraction @views[i], fractions[i] + + @emit KDFlex.EVENT_EXPANDED, fractions + view._windowDidResize?() + + # This will handle collapse request of the view, it will set fraction + # as KDFlex.MIN for requested view and will do KDFlex.MAX for other view + # it will also fire the same event which will cause a chain reaction + # on parent resizers to do same. It will allow us to collapse nested + # views up to the parent one ~ GG + view.on KDFlex.EVENT_COLLAPSE, => + + # This will start chain reaction for collapsing parent views + @emit KDFlex.EVENT_COLLAPSE + + fractions = [] + viewIndex = @_getViewIndex view + for i in [0..1] + fractions.push @_fractions[i] ? 50 + @_setViewFraction @views[i], fractions[i] + @views[i].unsetClass 'expanded' + + @emit KDFlex.EVENT_COLLAPSED, fractions + view._windowDidResize?() + + + view.on KDFlex.EVENT_HIDE, => + + fractions = [Flex.MAX, KDFlex.MAX] + viewIndex = @_getViewIndex view + fractions[viewIndex] = KDFlex.MIN + + for i in [0..1] + @_setViewFraction @views[i], fractions[i] + + @emit KDFlex.EVENT_HIDDEN, fractions + view._windowDidResize?() + + # Custom Resize events for programatically resize the view based on the + # given percentage, the other side will be resized to KDFlex.MAX - + # Triggering storage is optional and disabled by default ~ GG + view.on KDFlex.EVENT_RESIZE, (options) => + + { percentage = KDFlex.MIN, store = no } = options + + leftOver = KDFlex.MAX - percentage + fractions = [leftOver, leftOver] + viewIndex = @_getViewIndex view + fractions[viewIndex] = percentage + + for i in [0..1] + @_setViewFraction @views[i], fractions[i] + + if store + @emit KDFlex.EVENT_RESIZED, fractions + + view._windowDidResize?() + + + _updateViewSizes: -> + # This will get height or width of given views. This height or width + # depends on the type of this KDFlexSplitResizer. For example; if we've + # a horizontal resizer then getter will be `getHeight` look constants. + @sizes = [ + @views[0][@type.getter]() + @views[1][@type.getter]() + ] + + # We need to know totalSize of the view including resizer's width or height + # Since we are not defining resizer handle size in code but in style we + # need to calculate that size dynamically as well + # + # This totalSize will become total width or total height of the KDFlexSplit + @totalSize = @sizes[0] + @sizes[1] + @[@type.getter]() + + + limited = (num) -> + Math.min KDFlex.MAX, Math.max KDFlex.MIN, num + + + _updateFractions: (change = 0, set = yes) -> + # This will calculate fractions for each view and will leave enough space + # for the resizer itself as well. For example on a 100px wide KDFlexSplit + # if you have a 4px wide resizer 96px will be distributed on the views. + # If they splitted even on the screen then their fractions will become + # 48% and 48%, remaining 4% is used by the resizer itself. ~ GG + for i in [0..1] + change = -change if i is 1 + @_fractions[i] = limited ((change + @sizes[i]) / @totalSize) * KDFlex.MAX + @_setViewFraction @views[i], @_fractions[i] if set + + + drag: (event, delta) -> + # on drag we are getting the delta based on the axis of this type + # of resizer x for VERTICAL, y for HORIZONTAL ptl. constants. + @_updateFractions delta[@type.axis] + + + dragFinished: (event, dragState) -> + + @unsetClass 'ondrag' + @emit KDFlex.EVENT_RESIZED, @_fractions + for view in @views + view.unsetClass 'ondrag' + view._windowDidResize?() + + + dragStarted: (event, dragState) -> + + for view in @views + view.unsetClass 'expanded' + view.setClass 'ondrag' + + @setClass 'ondrag' + + @_updateViewSizes() + + + setFractions: (fractions, options = {}) -> + + { updateViews = yes, initialFractions = [50, 50] } = options + + @_fractions = initialFractions + return unless updateViews + + for index in [0..1] + @_setViewFraction @views[index], fractions[index] + if fractions[index] is KDFlex.MAX + @views[index].setClass 'expanded' + + + _setViewFraction: (view, fraction) -> + view.setCss 'flex-basis', "#{fraction}%" + view._windowDidResize?() From 0764e15056a3fb55276f4e8e7e5a4043612b84fa Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:37:17 -0800 Subject: [PATCH 03/13] FlexSplit: FlexSplit initial commit --- lib/components/flexsplit/flexsplit.coffee | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 lib/components/flexsplit/flexsplit.coffee diff --git a/lib/components/flexsplit/flexsplit.coffee b/lib/components/flexsplit/flexsplit.coffee new file mode 100644 index 00000000..e7b654db --- /dev/null +++ b/lib/components/flexsplit/flexsplit.coffee @@ -0,0 +1,81 @@ +KD = require '../../core/kd' +KDView = require '../../core/view' + +KDFlex = require './flex' +KDFlexSplitResizer = require './flexresizer' + + +module.exports = class KDFlexSplit extends KDView + + # Keep copy of constants on KDFlexSplit for external uses + for own key, value of KDFlex + KDFlexSplit[key] = value + + constructor: (options = {}, data) -> + + options.cssClass = KD.utils.curry 'flex-split', options.cssClass + options.sizes ?= [] + options.type ?= KDFlex.HORIZONTAL + options.resizable ?= yes + + super options, data + + @_type = KDFlex.INSTANCE_TYPE + + @resizer = null + { @type, @name, storage } = @getOptions() + @setClass @type.name + + @setupViews() + + storage?.addView this, @name + + + createResizer: (view, size) -> + + @resizer = @addSubView new KDFlexSplitResizer { @type, view } + + @forwardEvents @resizer, [ + KDFlex.EVENT_EXPANDED + KDFlex.EVENT_RESIZED + KDFlex.EVENT_HIDDEN + KDFlex.EVENT_COLLAPSED + ] + + @resizer.on KDFlex.EVENT_EXPAND, -> + if KDFlexSplit.isInstance view.parent + view.parent.emit KDFlex.EVENT_EXPAND + + @resizer.on KDFlex.EVENT_COLLAPSE, -> + if KDFlexSplit.isInstance view.parent + view.parent.emit KDFlex.EVENT_COLLAPSE + + + setupViews: -> + + { sizes, views, resizable } = @getOptions() + + views.forEach (view, index) => + + unless view.hasClass 'flex-split' + view.setClass 'flex-view' + + if sizes[index]? + size = sizes[index] + view.setCss 'flex-basis', "#{size}%" + + @addSubView view + + if resizable + view.setCss 'flex-basis', '50%' unless size? + @resizer?.addView view, size + if views[index + 1] + @createResizer view, size + + + setFractions: (fractions, options) -> + @resizer?.setFractions fractions, options + + + @isInstance = (instance) -> + instance?._type is KDFlex.INSTANCE_TYPE From 6bcfdeba0600721684182da3fb5a59e7471c0711 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:37:51 -0800 Subject: [PATCH 04/13] FlexSplit: FlexSplitStorage initial commit --- lib/components/flexsplit/flexstorage.coffee | 72 +++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 lib/components/flexsplit/flexstorage.coffee diff --git a/lib/components/flexsplit/flexstorage.coffee b/lib/components/flexsplit/flexstorage.coffee new file mode 100644 index 00000000..beaca081 --- /dev/null +++ b/lib/components/flexsplit/flexstorage.coffee @@ -0,0 +1,72 @@ +KD = require '../../core/kd' +KDObject = require '../../core/object' + +KDFlex = require './flex' + + +module.exports = class KDFlexSplitStorage extends KDObject + + + constructor: (options = {}, data) -> + + super options, data + + @storage = {} + @viewCount = 0 + @eventCount = 0 + + if adapterClass = @getOption 'adapter' + @adapter = new adapterClass + + + addView: (view, identifier, options = {}) -> + + options.restore ?= yes + options.keepExpandStatus ?= yes # Experimental + + view.on [ KDFlex.EVENT_RESIZED, KDFlex.EVENT_HIDDEN ], (fractions) => + @set identifier, fractions + @store() + + if options.keepExpandStatus + view.on [ + KDFlex.EVENT_EXPANDED + KDFlex.EVENT_COLLAPSED + ], (fractions) => + + @eventCount++ + @set identifier, fractions + + if @eventCount is @viewCount - 1 + @eventCount = 0 + @store() + + @viewCount++ + + KD.utils.wait 500, => + + @get identifier, (fractions) => + + sizes = view.getOption 'sizes' + fractions ?= sizes + + if options.restore and fractions + view.setFractions fractions, { initialFractions: sizes } + @set identifier, fractions + + + get: (identifier, callback) -> + if @adapter + then @adapter.get identifier, callback + else callback @storage[identifier] + + + set: (identifier, fractions, callback = KD.noop) -> + @storage[identifier] = fractions + callback null, @storage + + + store: (callback = KD.noop) -> + if @adapter?.store? + then @adapter.store @storage, callback + else callback null From 9aa2b307fd889e3930de91be53ed4c32c66b68b0 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:39:01 -0800 Subject: [PATCH 05/13] FlexSplit: default styles --- lib/styles/default/kd.flexsplit.styl | 32 ++++++++++++++++++++++++++++ lib/styles/default/kdfn.styl | 5 ++--- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 lib/styles/default/kd.flexsplit.styl diff --git a/lib/styles/default/kd.flexsplit.styl b/lib/styles/default/kd.flexsplit.styl new file mode 100644 index 00000000..aba1e900 --- /dev/null +++ b/lib/styles/default/kd.flexsplit.styl @@ -0,0 +1,32 @@ +@import "./kdfn" + +/* +** KDFlexSplit STYLES +*/ + +.flex-split + + overflow hidden + flex() + + &.vertical + flex-flow row nowrap + > .flex-resizer + width 4px + cursor ew-resize + + &.horizontal + flex-flow column nowrap + > .flex-resizer + height 4px + cursor ns-resize + + .flex-resizer + flex none + z-index 100 + background #333 + flex() + + .flex-view + overflow hidden + borderBox() diff --git a/lib/styles/default/kdfn.styl b/lib/styles/default/kdfn.styl index d58de45a..a3c709d1 100644 --- a/lib/styles/default/kdfn.styl +++ b/lib/styles/default/kdfn.styl @@ -148,8 +148,8 @@ kalc() {arguments[0]} calc(arguments[1]) arguments[2] flex() - display -webkit-box - display -moz-box + display -webkit-flex + display -moz-flex display flex singleTransformTransition() @@ -178,4 +178,3 @@ cf() &:after clear both - From 649d2391fd747610730c1a5ac0e141741911ce79 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:39:26 -0800 Subject: [PATCH 06/13] KD: require FlexSplit component family and default styles --- lib/index.coffee | 4 ++++ lib/styles/index.styl | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/index.coffee b/lib/index.coffee index be5304ec..e56a7f2d 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -37,6 +37,10 @@ module.exports.extend DiaObject : require "./components/dia/diaobject" DiaScene : require "./components/dia/diascene" DialogView : require "./components/dialog/dialogview" + Flex : require "./components/flexsplit/flex" + FlexResizer : require "./components/flexsplit/flexresizer" + FlexSplit : require "./components/flexsplit/flexsplit" + FlexStorage : require "./components/flexsplit/flexstorage" FormView : require "./components/forms/formview" FormViewWithFields : require "./components/forms/formviewwithfields" HeaderView : require "./components/header/headerview" diff --git a/lib/styles/index.styl b/lib/styles/index.styl index 2aa2ea4b..c608ad60 100644 --- a/lib/styles/index.styl +++ b/lib/styles/index.styl @@ -1,5 +1,6 @@ @import "./reset.css" @import "./default/kd.styl" +@import "./default/kd.flexsplit" @import "./default/kd.input" @import "./default/kd.treeview" @import "./default/kd.contextmenu" From 246b8c7023f70f90a77dbd0dd9c432c08e3b19a1 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Mon, 20 Feb 2017 23:45:43 -0800 Subject: [PATCH 07/13] Example: update with FlexSplit example --- example/index.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/example/index.js b/example/index.js index 9fda271b..cd44217b 100644 --- a/example/index.js +++ b/example/index.js @@ -3,6 +3,28 @@ var kd = require('../lib/index'); var main = new kd.View; main.appendToDomBody(); +var flex = new kd.FlexSplit({ + cssClass: 'mainview', + resizable: true, + type: kd.Flex.VERTICAL, + views: [ + new kd.FlexSplit({ + sizes: [ 40, 60 ], + views: [ + new kd.View({ partial: 'left top' }), + new kd.View({ partial: 'left bottom' }) + ] + }), + new kd.FlexSplit({ + sizes: [ 20, 80 ], + views: [ + new kd.View({ partial: 'right top' }), + new kd.View({ partial: 'right bottom' }) + ] + }) + ] +}) + var input = new kd.InputView; var form = new kd.View; @@ -16,6 +38,9 @@ form.addSubView(new kd.ButtonView({ var tabs = new kd.TabView({ hideHandleCloseIcons: true, + attributes: { + style: 'height: 100vh' + }, paneData: [ { title: 'tab1', @@ -24,6 +49,10 @@ var tabs = new kd.TabView({ { title: 'form', view: form + }, + { + title: 'flex split', + view: flex } ] }); From 371e26216fdb781861827507d40be3b907534e31 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Tue, 21 Feb 2017 23:02:07 -0800 Subject: [PATCH 08/13] FlexResizer: fix typo on fractions definition --- lib/components/flexsplit/flexresizer.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/flexsplit/flexresizer.coffee b/lib/components/flexsplit/flexresizer.coffee index 55d8afd5..2e3d56a5 100644 --- a/lib/components/flexsplit/flexresizer.coffee +++ b/lib/components/flexsplit/flexresizer.coffee @@ -79,7 +79,7 @@ module.exports = class KDFlexSplitResizer extends KDView view.on KDFlex.EVENT_HIDE, => - fractions = [Flex.MAX, KDFlex.MAX] + fractions = [KDFlex.MAX, KDFlex.MAX] viewIndex = @_getViewIndex view fractions[viewIndex] = KDFlex.MIN From c403c82b9513a082408fa12488db0fe7c328aeb1 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Tue, 21 Feb 2017 23:02:28 -0800 Subject: [PATCH 09/13] Test: FlexSplit: Flex test added --- test/components/flexsplit/flex.coffee | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/components/flexsplit/flex.coffee diff --git a/test/components/flexsplit/flex.coffee b/test/components/flexsplit/flex.coffee new file mode 100644 index 00000000..5a89bbbb --- /dev/null +++ b/test/components/flexsplit/flex.coffee @@ -0,0 +1,34 @@ +should = require 'should' +sinon = require 'sinon' +KDFlex = require '../../../lib/components/flexsplit/flex' + +describe 'KDFlex', -> + + it 'should exists', -> + KDFlex.should.exist + + describe 'constants', -> + + it 'should have instance type exists', -> + KDFlex.INSTANCE_TYPE.should.exist + + it 'should have action events exists', -> + KDFlex[e].should.exist for e in [ + 'EVENT_HIDE', 'EVENT_RESIZE', 'EVENT_EXPAND', 'EVENT_COLLAPSE' + ] + + it 'should have state changed events exists', -> + KDFlex[e].should.exist for e in [ + 'EVENT_HIDDEN', 'EVENT_RESIZED', 'EVENT_EXPANDED', 'EVENT_COLLAPSED' + ] + + it 'should have min & max values exists', -> + KDFlex.MIN.should.exist + KDFlex.MAX.should.exist + + it 'should have type constants exists', -> + for e in [ 'HORIZONTAL', 'VERTICAL' ] + KDFlex[e].should.exist + KDFlex[e].name.should.exist + KDFlex[e].axis.should.exist + KDFlex[e].getter.should.exist From b63ef5f5ffa952d5ce3c0ad3dcbbec939acad8f3 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Wed, 22 Feb 2017 00:33:54 -0800 Subject: [PATCH 10/13] FlexSplit: generate a unique name if name not provided --- lib/components/flexsplit/flexsplit.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/components/flexsplit/flexsplit.coffee b/lib/components/flexsplit/flexsplit.coffee index e7b654db..ddcc9d59 100644 --- a/lib/components/flexsplit/flexsplit.coffee +++ b/lib/components/flexsplit/flexsplit.coffee @@ -14,6 +14,7 @@ module.exports = class KDFlexSplit extends KDView constructor: (options = {}, data) -> options.cssClass = KD.utils.curry 'flex-split', options.cssClass + options.name ?= "flex-#{KD.utils.getUniqueId()}" options.sizes ?= [] options.type ?= KDFlex.HORIZONTAL options.resizable ?= yes From faf09f0c687cdc161f99497874cb7c2c96818309 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Wed, 22 Feb 2017 00:34:19 -0800 Subject: [PATCH 11/13] Test: FlexSplit: FlexSplit test added for all cases --- test/components/flexsplit/flexsplit.coffee | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 test/components/flexsplit/flexsplit.coffee diff --git a/test/components/flexsplit/flexsplit.coffee b/test/components/flexsplit/flexsplit.coffee new file mode 100644 index 00000000..4ac51d3b --- /dev/null +++ b/test/components/flexsplit/flexsplit.coffee @@ -0,0 +1,83 @@ +should = require 'should' +sinon = require 'sinon' + +KD = require '../../../lib/core/kd' +KDView = require '../../../lib/core/view' +KDFlex = require '../../../lib/components/flexsplit/flex' +KDFlexSplit = require '../../../lib/components/flexsplit/flexsplit' +KDFlexSplitResizer = require '../../../lib/components/flexsplit/flexresizer' + + +describe 'KDFlexSplit', -> + + it 'should exists', -> + KDFlexSplit.should.exist + + beforeEach -> + @sinon = sinon.sandbox.create() + @callback = @sinon.stub() + @view1 = new KDView { partial: 'top' } + @view2 = new KDView { partial: 'bottom' } + + @o = {} + @o.views = [ @view1, @view2 ] + + @instance = new KDFlexSplit @o, {} + + @instance.appendToDomBody() + + afterEach -> + for view in [ @view1, @view2, @instance ] + view.destroy() + @sinon.restore() + + describe 'constructor', -> + + it 'should instantiate without any error', -> + (@instance instanceof KDFlexSplit).should.equal true + + it 'should generate a unique name if not provided', -> + (/flex-/.test @instance.name).should.equal true + + it 'should instantiate with HORIZONTAL type by default', -> + @instance.type.should.equal KDFlex.HORIZONTAL + + it 'should have a class set with the given type', -> + @instance.hasClass(KDFlex.HORIZONTAL.name).should.equal true + + it 'should set flex-view class to given views', -> + for view in [ @view1, @view2 ] + view.hasClass('flex-view').should.equal true + + it 'should instantiate views with 50%-50% base by default', -> + for view in [ @view1, @view2 ] + view.getAttribute('style').should.equal 'flex-basis: 50%;' + + it 'should create a resizer', -> + (@instance.resizer instanceof KDFlexSplitResizer).should.equal true + + it 'should support expand events', -> + + @instance.on KDFlex.EVENT_EXPANDED, @callback + + @view1.emit KDFlex.EVENT_EXPAND + @view1.getAttribute('style').should.equal "flex-basis: #{KDFlex.MAX}%;" + @view2.getAttribute('style').should.equal "flex-basis: #{KDFlex.MIN}%;" + + @callback.calledOnce.should.equal true + + it 'should support collapse events', -> + + @instance.on KDFlex.EVENT_COLLAPSED, @callback + + @view1.emit KDFlex.EVENT_COLLAPSE + @view1.getAttribute('style').should.equal 'flex-basis: 50%;' + @view2.getAttribute('style').should.equal 'flex-basis: 50%;' + + @callback.calledOnce.should.equal true + + it 'should support custom resizing', -> + + @instance.setFractions [20, 80] + @view1.getAttribute('style').should.equal 'flex-basis: 20%;' + @view2.getAttribute('style').should.equal 'flex-basis: 80%;' From b724aa890eb3094e1b53655ad82a8b87c2f94180 Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Wed, 22 Feb 2017 12:29:31 -0800 Subject: [PATCH 12/13] Update version to 1.1.30 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6c6d62d..dc611fa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kd.js", - "version": "1.1.29", + "version": "1.1.30", "description": "a collection of ui widgets and other nice things", "main": "build/lib/index.js", "scripts": { From 792168a19fc1c4c8c5c9706e09c7fb07446b33ad Mon Sep 17 00:00:00 2001 From: Gokmen Goksel Date: Wed, 22 Feb 2017 13:01:03 -0800 Subject: [PATCH 13/13] Update travis config to test with lts only --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6476da9..1e93f43f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,6 @@ language: node_js node_js: - - "0.10" - - "0.12" - - "4.4" - - "5.11" - - "6.1" + - "6.10" before_install: - npm install -g npm