Commit Graph

24 Commits

Author SHA1 Message Date
David Baumgold
d97921e6e2 Convert Studio JS to use require.js 2013-10-04 13:43:50 -04:00
Peter Fogg
8b13ff3dff Merge pull request #376 from edx/peter-fogg/rename-notification-save
Rename CMS.Views.Notification.Saving to Mini.
2013-07-11 14:25:44 -07:00
Peter Fogg
6e94960488 Fix many validation bugs and failing tests. 2013-07-11 16:09:59 -04:00
Peter Fogg
9c8f63726f Rename CMS.Views.Notification.Saving to Mini, in line with its more diverse modern usage. 2013-07-11 13:13:08 -04:00
David Baumgold
307c6c1715 CMS.Views.Notification.Saving should have sensible defaults
minShown = 1250, closeIcon = false
2013-07-09 19:16:07 -04:00
David Baumgold
ddc986f775 Call event.preventDefault() on notification action buttons
But allow you to specify that the event should not be prevented
2013-06-25 11:29:42 -04:00
David Baumgold
72ffe2d8f2 Backbone notifications secondary actions
Handle secondary actions on notifications either specified as a single object,
or as a list of objects. Under the hood, the initialize method converts a single
object to a list containing a single object.
2013-06-24 13:44:50 -04:00
David Baumgold
687779ba34 Clean up assets page notifications
Remove hack to work around multiple notification click issues -- and actually resolve
the issue so that the hack isn't necessary
2013-06-19 12:01:44 -04:00
David Baumgold
b6e3b0ee03 Refactor Backbone Notifications
Models are extraneous for something as temporary as a notifaction -- this change
moves all the configuration into the views, and removes the models entirely.
2013-06-18 10:20:31 -04:00
David Baumgold
9e864834bd Unify system feedback templates
Also, a SystemFeedback model no longer has a `type`, it has an `intent`. This is
because SystemFeedback views have `type`, as well, and this prevents a naming
collision.
2013-05-22 15:55:55 -04:00
David Baumgold
1e7e38824a Shorten secondary action detection code 2013-05-22 15:55:54 -04:00
David Baumgold
56d8a467c8 Add tests for minShown and maxShown in views 2013-05-22 15:55:52 -04:00
David Baumgold
09a8075355 If a Backbone view can't find its template, I want to know 2013-05-22 15:55:52 -04:00
David Baumgold
fcf4cdc75e Implement minShown and maxShown for notification views 2013-05-22 15:55:51 -04:00
David Baumgold
91c2594c8d Fix section name validation alerting 2013-05-22 15:55:51 -04:00
David Baumgold
4af3325976 Move display logic into view
Model shouldn't know about things like close buttons, visibility, and so on
2013-05-22 15:55:51 -04:00
David Baumgold
fedfe8627f Add tests for click events on views 2013-05-22 15:55:51 -04:00
David Baumgold
070d24cf61 Jasmine doesn't like asserting on the <body> element :( 2013-05-22 15:55:51 -04:00
David Baumgold
69a6ec0c97 Don't fall over if a model doesn't have actions defined
It appears that one notification stealing focus from another causes some weirdness:
both clicking on a button on one view triggers the event on both views (the original
and the new view that stole the div). As long as the first view does *not* define
any click events, everything is fine -- this is the case for the saving notification.
I'll worry about the reason for this later; it has something to do with views
listening to models even after they no longer should be.
2013-05-22 15:55:50 -04:00
David Baumgold
1333717871 Message action callbacks have model set to this 2013-05-22 15:55:50 -04:00
David Baumgold
cd2f67afa4 Clone the attributes object
So that modifications don't affect the model
2013-05-22 15:55:49 -04:00
David Baumgold
5746121f5c Set up Notification and Prompt 2013-05-22 15:55:49 -04:00
David Baumgold
5c2116a4b3 Make abstract view, make Alert inherit from it 2013-05-22 15:55:49 -04:00
David Baumgold
5ff2adb882 Rename alert model to SystemFeedback 2013-05-22 15:55:48 -04:00