# HG changeset patch # User Drew Perttula # Date 2017-06-10 04:47:22 # Node ID 7d2871f49806f02d909334c8f272861833d0e7a5 # Parent 0eb5f70bdde2f18b6c8fd9da547992fb1c6f5d11 relayout live page. fix jank from moving sliders. Ignore-this: 7478b5249dd34a2b42bf63be0487599d diff --git a/light9/web/lib/bower.json b/light9/web/lib/bower.json --- a/light9/web/lib/bower.json +++ b/light9/web/lib/bower.json @@ -4,7 +4,7 @@ "polymer": "~1.4.0", "paper-slider": "PolymerElements/paper-slider#~1.0.11", "iron-ajax": "PolymerElements/iron-ajax#~1.2.0", - "jquery": "~2.2.4", + "jquery": "^3.2.1", "underscore": "~1.8.3", "jquery-ui": "~1.11.4", "QueryString": "http://unixpapa.com/js/QueryString.js", @@ -23,13 +23,17 @@ "paper-radio-group": "PolymerElements/paper-radio-group#^1.2.2", "color": "https://github.com/One-com/one-color.git#^3.0.4", "paper-listbox": "PolymerElements/paper-listbox#1.1.3", - "paper-item": "PolymerElements/paper-item#1.2.2" + "paper-item": "PolymerElements/paper-item#1.2.2", + "isotope": "^3.0.4", + "isotope-fit-columns": "^1.1.3", + "jquery.columnizer": "https://github.com/adamwulf/Columnizer-jQuery-Plugin.git#^1.6.2" }, "resolutions": { "paper-styles": "^1.1.4", "rdflib.js": "920e59fe37", "d3": "e7194db33090a0afc06c77a959594361ffb949df", "webcomponentsjs": "^0.7.24", - "polymer": "^1.2.1" + "polymer": "^1.2.1", + "jquery": "^3.2.1" } } diff --git a/light9/web/live/index.html b/light9/web/live/index.html --- a/light9/web/live/index.html +++ b/light9/web/live/index.html @@ -16,12 +16,29 @@ + - + diff --git a/light9/web/live/live.coffee b/light9/web/live/live.coffee --- a/light9/web/live/live.coffee +++ b/light9/web/live/live.coffee @@ -97,6 +97,9 @@ Polymer ready: -> @currentSettings = {} @effectPreview = JSON.stringify({}) + + @sendAllThrottled = _.throttle(@sendAll.bind(@), 30) + window.gather = (sent) => [dev, devAttr, value] = sent[0] key = dev + " " + devAttr @@ -110,7 +113,7 @@ Polymer @currentSettings[key] = [dev, devAttr, value] @effectPreview = JSON.stringify(v for k,v of @currentSettings) - @debounce('send', @sendAll.bind(@), 2) + @sendAllThrottled() currentSettingsList: -> (v for k,v of @currentSettings) @@ -169,3 +172,16 @@ Polymer for dc in _.sortBy(@graph.subjects(U('rdf:type'), U(':DeviceClass'))) for dev in _.sortBy(@graph.subjects(U('rdf:type'), dc)) @push('devices', {uri: dev}) + + return + + # Tried css columns- big slowdown from relayout as I'm scrolling. + # Tried isotope- seems to only scroll to the right. + # Tried columnize- fails in jquery maybe from weird elements. + + # not sure how to get this run after the children are created + setTimeout((() => $('#deviceControls').isotope({ + # fitColumns would be nice, but it doesn't scroll vertically + layoutMode: 'masonry', + containerStyle: null + })), 2000)