From ee6657f05c7d360a5c34e817e7041227530b4f10 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 19 Jan 2017 16:21:04 +0100 Subject: [PATCH] add caret to dropdownpanel / remove ASMCode.js --- src/ui/ASMCode.js | 55 ---------------------------------- src/ui/DropdownPanel.js | 8 +++++ src/ui/styles/basicStyles.js | 4 ++- src/ui/styles/dropdownPanel.js | 4 ++- 4 files changed, 14 insertions(+), 57 deletions(-) delete mode 100644 src/ui/ASMCode.js diff --git a/src/ui/ASMCode.js b/src/ui/ASMCode.js deleted file mode 100644 index e74c02a854..0000000000 --- a/src/ui/ASMCode.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict' -var style = require('./styles/basicStyles') -var yo = require('yo-yo') -var ui = require('../helpers/ui') - -function ASMCode (_parent, _codeManager) { - this.parent = _parent - this.codeManager = _codeManager - this.code - this.address - this.codeView - - this.init() -} - -ASMCode.prototype.render = function () { - var view = ( - yo`` - ) - if (!this.view) { - this.view = view - } - return view -} - -ASMCode.prototype.init = function () { - this.codeManager.event.register('changed', this, this.changed) -} - -ASMCode.prototype.indexChanged = function (index) { - document.getElementById('asmitems').value = index -} - -ASMCode.prototype.changed = function (code, address, index) { - if (this.address !== address) { - this.code = code - this.address = address - this.renderAssemblyItems() - yo.update(this.view, this.render()) - } - this.indexChanged(index) -} - -ASMCode.prototype.renderAssemblyItems = function () { - if (this.code) { - this.codeView = this.code.map(function (item, i) { - return yo`` - }) - return this.codeView - } -} - -module.exports = ASMCode diff --git a/src/ui/DropdownPanel.js b/src/ui/DropdownPanel.js index 8f36e1071d..55dc1f661c 100644 --- a/src/ui/DropdownPanel.js +++ b/src/ui/DropdownPanel.js @@ -41,6 +41,7 @@ DropdownPanel.prototype.render = function (overridestyle) { var self = this var view = yo`
+
${this.name}