in 'standalone' mode, the close button is hidden
... publisher is embedded into something, that has its own close button
This commit is contained in:
parent
452de1b866
commit
8193978fd2
3 changed files with 23 additions and 0 deletions
|
|
@ -42,6 +42,12 @@ app.views.Publisher = Backbone.View.extend(_.extend(
|
|||
this.el_hiddenInput.val( this.el_input.val() );
|
||||
}
|
||||
|
||||
// hide close button, in case publisher is standalone
|
||||
// (e.g. bookmarklet, mentions popup)
|
||||
if( this.options.standalone ) {
|
||||
this.$('#hide_publisher').hide();
|
||||
}
|
||||
|
||||
// this has to be here, otherwise for some reason the callback for the
|
||||
// textchange event won't be called in Backbone...
|
||||
this.el_input.bind('textchange', $.noop);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,22 @@
|
|||
*/
|
||||
|
||||
describe("app.views.Publisher", function() {
|
||||
describe("standalone", function() {
|
||||
beforeEach(function() {
|
||||
// should be jasmine helper
|
||||
loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
|
||||
|
||||
spec.loadFixture("aspects_index");
|
||||
this.view = new app.views.Publisher({
|
||||
standalone: true
|
||||
});
|
||||
});
|
||||
|
||||
it("hides the close button in standalone mode", function() {
|
||||
expect(this.view.$('#hide_publisher').is(':visible')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
context("plain publisher", function() {
|
||||
beforeEach(function() {
|
||||
// should be jasmine helper
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ describe("bookmarklet", function() {
|
|||
|
||||
it('verifies we are using the bookmarklet', function(){
|
||||
expect(app.publisher.options.standalone).toBeTruthy();
|
||||
expect(app.publisher.$('#hide_publisher').is(':visible')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue