From: David Schoonover Date: Tue, 5 Jun 2012 01:40:16 +0000 (-0700) Subject: Checkpoint. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=2923ac7c7ab4f76e99fc86aa6043b2f440afa323;p=kraken-ui.git Checkpoint. --- diff --git a/lib/base/base-view.co b/lib/base/base-view.co index 8b15fac..0532d21 100644 --- a/lib/base/base-view.co +++ b/lib/base/base-view.co @@ -58,7 +58,7 @@ BaseView = exports.BaseView = Backbone.View.extend mixinBase do # {{{ @setModel @model @build() - @$el.on 'form submit', -> false + @$el.on 'form submit', -> it.preventDefault() setModel: (model) -> if @model diff --git a/lib/graph/graph-model.co b/lib/graph/graph-model.co index c5b59ce..c205d16 100644 --- a/lib/graph/graph-model.co +++ b/lib/graph/graph-model.co @@ -68,8 +68,12 @@ Graph = exports.Graph = BaseModel.extend do # {{{ # dataset : null width : 'auto' height : 320 - chartType : 'dygraphs' parents : <[ root ]> + callout : + enabled : true + metric_idx : 0 + label : '' + chartType : 'dygraphs' options : {} url: -> diff --git a/lib/graph/graph-view.co b/lib/graph/graph-view.co index 659b760..80c6a6c 100644 --- a/lib/graph/graph-view.co +++ b/lib/graph/graph-view.co @@ -153,6 +153,12 @@ GraphView = exports.GraphView = BaseView.extend do # {{{ @chart = @chartType.render() this + /** + * Render the callout element. + */ + renderCallout: -> + + this /** * Render the chart and other Graph-derived view components. diff --git a/lib/main-edit.co b/lib/main-edit.co index 0ccad34..4ead2d5 100644 --- a/lib/main-edit.co +++ b/lib/main-edit.co @@ -21,13 +21,7 @@ root = this CHART_OPTIONS_SPEC = [] CHART_DEFAULT_OPTIONS = {} - -# Create the Graph Scaffold main = -> - # Set up Dygraph chart type spec - # TODO: load this on-demand - # dyglib = new DygraphsChartType CHART_OPTIONS_SPEC - # Bind to URL changes History.Adapter.bind window, 'statechange', -> # console.log 'StateChange!\n\n', String(root.location), '\n\n' @@ -58,18 +52,4 @@ main = -> @model = root.graph = new Graph data, {+parse} @view = root.view = new GraphEditView {@model} - -# Load data files -# Seq([ <[ CHART_OPTIONS_SPEC /schema/dygraph.json ]> -# ]) -# .parEach_ (next, [key, url]) -> -# jQuery.ajax do -# url : url, -# success : (res) -> -# root[key] = res -# next.ok() -# error : (err) -> console.error err -# .seq -> -# jQuery main - jQuery main