Skip to content

Commit 78a6eaa

Browse files
author
Philip Guo
committed
more robust!!!
1 parent 6a8c4ae commit 78a6eaa

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎v3/commentary-bubbles-demo.css‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ textarea.bubbleInputText {
66

77
/* make sure textarea doesn't grow and stretch the enclosing bubble */
88
resize: none;
9-
width: 230px;
10-
max-width: 230px;
9+
width: 225px;
10+
max-width: 225px;
1111
height: 35px;
1212
max-height: 35px;
1313
}
@@ -64,7 +64,7 @@ textarea.bubbleInputText {
6464
}
6565

6666
.ui-tooltip-pgbootstrap .ui-tooltip-content{
67-
padding: 5px /* 5px is minimum or else it might look ugly */ 7px;
67+
padding: 5px /* 5px is minimum or else it might look ugly */ 8px;
6868
}
6969

7070

@@ -108,11 +108,16 @@ textarea.bubbleInputText {
108108

109109

110110
.ui-tooltip-pgbootstrap-stub{
111-
border: 2px solid #999;
111+
border: 1px solid #888;
112112

113113
/*
114114
-webkit-box-shadow: none;
115115
-moz-box-shadow: none;
116116
box-shadow: none;
117117
*/
118118
}
119+
120+
.ui-tooltip-pgbootstrap-stub .ui-tooltip-content{
121+
padding: 6px 9px;
122+
}
123+

‎v3/commentary-bubbles-demo.js‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ AnnotationBubble.prototype.showStub = function() {
128128
}
129129

130130
AnnotationBubble.prototype.showEditor = function() {
131-
assert(this.state == 'stub' || this.state == 'view');
131+
assert(this.state == 'stub' || this.state == 'view' || this.state == 'minimized');
132132

133133
var myBubble = this; // to avoid name clashes with 'this' in inner scopes
134134

@@ -214,8 +214,15 @@ AnnotationBubble.prototype.minimizeViewer = function() {
214214
$(this.qTipID())
215215
.unbind('click') // unbind all old handlers
216216
.click(function() {
217-
assert(globalAnnotationMode == 'view');
218-
myBubble.restoreViewer();
217+
if (globalAnnotationMode == 'edit') {
218+
myBubble.showEditor();
219+
}
220+
else if (globalAnnotationMode == 'view') {
221+
myBubble.restoreViewer();
222+
}
223+
else {
224+
assert(false);
225+
}
219226
});
220227

221228
this.state = 'minimized';
@@ -250,10 +257,7 @@ AnnotationBubble.prototype.qTipID = function() {
250257

251258
AnnotationBubble.prototype.enterEditMode = function() {
252259
assert(globalAnnotationMode == 'edit');
253-
if (this.state == 'minimized') {
254-
this.restoreViewer();
255-
}
256-
else if (this.state == 'hidden') {
260+
if (this.state == 'hidden') {
257261
this.showStub();
258262
}
259263
}

0 commit comments

Comments
 (0)