Commit Graph

225 Commits

Author SHA1 Message Date
Min RK
befb16ebe3 Merge pull request #6948 from bollwyvl/graceful-mathjax-widgets
Ignore failure of widget MathJax typesetting
2014-12-05 15:40:39 -08:00
Jonathan Frederic
e519371402 Merge pull request #7093 from jasongrout/model-views
Make the model.views dict a dict of promises for views
2014-12-05 08:31:06 -08:00
Nicholas Bollweg (Nick)
83757b6a0e moving typeset to utils, usage in cell and outputarea 2014-12-04 21:06:34 -05:00
Nicholas Bollweg (Nick)
c95a9aaf80 accept node or selection 2014-12-04 11:03:30 -05:00
Nicholas Bollweg (Nick)
b17a40d950 moving typeset to DOMWidgetView 2014-12-04 11:03:30 -05:00
Nicholas Bollweg (Nick)
57f05c4a2b reversing order of arguments, as text may already exist 2014-12-04 11:03:29 -05:00
Nicholas Bollweg (Nick)
00fc31b0a8 also setting text in widget.typset 2014-12-04 11:02:10 -05:00
Nicholas Bollweg (Nick)
9cd878cf0f moving, checking MathJax typesetting to WidgetView
widget rendering should not fail hard if MathJax is not available
2014-12-04 11:01:00 -05:00
Jonathan Frederic
5a9e4d7986 Manual fixes 2014-12-03 13:46:34 -08:00
Jonathan Frederic
b53386b37b Ran function comment conversion tool 2014-12-03 13:42:43 -08:00
Jason Grout
13c1b95fbd Make the model.views dict a dict of promises for views
Otherwise, there is a race condition where the model doesn't know about views until they are actually created.
2014-12-03 19:30:05 +00:00
Jason Grout
63f8566c6f Wait for any promises returned by a view's render method before considering the view created
This lets a view wait on children views to be created before considering itself created.

Thanks to @ssunkara for catching this.
2014-12-02 22:38:19 +00:00
Jason Grout
3c98127f7c remove obsolete optimization 2014-11-26 15:17:01 +00:00
Jason Grout
e6a8ef00e0 Catch errors after our then()s, instead of in parallel with them (this missing exceptions)
When an error is thrown in a then() success handler, it doesn't call the same then()'s error handler.

I also made all of the utils.reject handlers verbose to aid in debugging.
2014-11-25 23:08:06 +00:00
Jason Grout
efe7098a60 Fix viewlist to use promises correctly
A viewlist wasn't getting properly populated before.  This also switches the list update to use splice for in-place updates.
2014-11-25 19:20:23 +00:00
Jason Grout
9553f30222 Update widget selection containers to reflect how viewlist works
add_child takes a model and returns a view.  remove_child takes a view and removes it.
the pop_child_view method is now gone.
2014-11-25 01:57:11 +00:00
Jason Grout
247ebf16f0 Add comments emphasizing the order of steps in widget box remove() methods 2014-11-25 01:44:35 +00:00
Jason Grout
e7065d5a9f Remove obsolete logic: storing references to child views in a view
Users are responsible for keeping track of views they create and removing them in a view's remove() method
2014-11-25 01:38:48 +00:00
Jason Grout
53472ba91b reimplement the add/remove class logic to not use do_diff and remove do_diff 2014-11-25 01:29:12 +00:00
Jason Grout
1e8b2473b3 Merge branch 'viewlists' of https://github.com/jasongrout/ipython into viewlists 2014-11-24 23:24:40 +00:00
Jason Grout
05d013db59 At least log an error if there is no create or remove defined.
We might just remove this...
2014-11-21 23:21:52 +00:00
Jason Grout
bc0cb3c8b5 Do something about do_diff being used for the class stuff in widgets 2014-11-21 23:20:48 +00:00
Jason Grout
88084db35d Return the viewlist from the update promise so that you can use it immediately.
The pattern is:

viewlist.update(new_list).then(function(new_view_list) {
   ...
})
2014-11-21 23:20:19 +00:00
Jonathan Frederic
d181172948 Implement view logic in selection containers. 2014-11-20 13:52:46 -08:00
Jason Grout
307a320284 tweak documentation for viewlists 2014-11-20 16:09:37 +00:00
Jason Grout
93f658bc9b Make a copy of the input list so that changes to the children list don't automagically change our reference list 2014-11-20 00:44:35 +00:00
Jason Grout
7658bab99f Missing semicolon 2014-11-20 00:43:39 +00:00
Jason Grout
a6b901fdd3 Make state_change initialization more conventional 2014-11-20 00:43:24 +00:00
Jason Grout
0164fd32ca Make error messages more consistent 2014-11-20 00:43:00 +00:00
Jason Grout
88ed50afad Refactor the do_diff and manual child view lists into a separate ViewList object 2014-11-19 23:38:49 +00:00
Jason Grout
2b96a97118 Simplify error-handling code
Thanks to @jdfreder for this change.
2014-11-19 19:43:22 +00:00
Jason Grout
da8cab76dd Clean up promises code some more. 2014-11-19 19:16:54 +00:00
Jonathan Frederic
db2ef15b81 Address @carreau 's comments 2014-11-18 11:31:32 -08:00
Jonathan Frederic
d033d6c1ea Make output widget reactive. 2014-11-18 11:29:35 -08:00
Jonathan Frederic
a5779bcd0e Output Widget 2014-11-18 11:29:35 -08:00
Matthias Bussonnier
0ee990614d Merge pull request #6923 from SylvainCorlay/toggle_button_tooltip
Tooltip on toggle button
2014-11-18 14:47:13 +01:00
Thomas Kluyver
7cf7d3f202 Merge pull request #6818 from jdfreder/race_conditions
Add promises to the widget framework.
2014-11-17 17:14:08 -08:00
Jonathan Frederic
f9d730d01e Address @takluyver 's review comments 2014-11-17 14:17:17 -08:00
Jonathan Frederic
907bde3b25 Address review comments 2014-11-15 08:49:45 -08:00
Jonathan Frederic
3c949aad92 Remove message promise. 2014-11-15 08:49:45 -08:00
Jonathan Frederic
0d591619c6 Make all tests async display safe 2014-11-15 08:49:44 -08:00
Jonathan Frederic
56c5020a84 bool_test passing with slimerjs 2014-11-15 08:49:44 -08:00
Jonathan Frederic
bed3a4cfda use es6 2014-11-15 08:48:36 -08:00
Jonathan Frederic
8c149c9112 Current state with lots and lots of debugging junk 2014-11-15 08:48:35 -08:00
Jonathan Frederic
b3c49fce66 Move the display Promise into a lower level method,
into the create view method of the widget manager.
This makes sure that views created by parent views
are also accounted for in the state/display order
guarantee.
2014-11-15 08:48:35 -08:00
Jonathan Frederic
fed878fed9 Don't throw Errors with Objects as the message/ 2014-11-15 08:48:35 -08:00
Jonathan Frederic
bbcd5cb55f Bug fixes 2014-11-15 08:48:34 -08:00
Jonathan Frederic
3870bb571b Use rsvp.js for Promises 2014-11-15 08:48:34 -08:00
Jonathan Frederic
c67dcc0dc3 Finished adding error handling. 2014-11-15 08:48:34 -08:00
Jonathan Frederic
1d1572421f Add a WrappedError class 2014-11-15 08:48:34 -08:00