-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show binding changes #263
Show binding changes #263
Changes from 8 commits
2cacb7a
4a62164
f8aa3e4
35693e0
fe1f05b
6edaaf2
a195261
aa4870c
61b15e0
e25b8ad
7961783
1856291
c8280d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -864,11 +864,20 @@ REPLConsole.prototype.scrollToBottom = function() { | |
this.outer.scrollTop = this.outer.scrollHeight; | ||
}; | ||
|
||
// Change the binding of the console | ||
// Change the binding of the console. | ||
REPLConsole.prototype.switchBindingTo = function(frameId, callback) { | ||
var url = this.getSessionUrl('trace'); | ||
var params = "frame_id=" + encodeURIComponent(frameId); | ||
postRequest(url, params, callback); | ||
var notification = document.createElement('div'); | ||
notification.className = "console-notification"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. var notification = document.createElement('div');
notification.className = "console-notification";
var _this = this;
postRequest(url, params, function() { Can we keep the flow like this here? The operations are "grouped" this way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to just feed a new input line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently the default unclassed console text color is black so it won't be visible. I can remove the div but the console text color will need to be changed |
||
|
||
var _this = this; | ||
postRequest(url, params, function() { | ||
notification.innerHTML = "Context has changed to: " + callback(); | ||
var lastPrompt = findLastChild(_this.inner, "console-prompt-box"); | ||
_this.inner.insertBefore(notification, lastPrompt); | ||
_this.scrollToBottom(); | ||
}); | ||
}; | ||
|
||
/** | ||
|
@@ -946,6 +955,14 @@ function removeAllChildren(el) { | |
} | ||
} | ||
|
||
function findLastChild(el, className) { | ||
for (var i = el.childNodes.length - 1; i > 0; -- i) { | ||
if (hasClass(el.childNodes[i], className)) { | ||
return el.childNodes[i]; | ||
} | ||
} | ||
} | ||
|
||
function findChild(el, className) { | ||
for (var i = 0; i < el.childNodes.length; ++ i) { | ||
if (hasClass(el.childNodes[i], className)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may drop this diff change as well, e.g. leave it as before: