Remove redundant scope by sharing one between browser and server code.

This commit is contained in:
Jürg Lehni 2011-08-22 11:05:59 +02:00
parent 0ee1e80c68
commit 7c2fabd6a1

View file

@ -443,7 +443,9 @@ var View = this.View = PaperScopeItem.extend(/** @lends View# */{
_views: {}, _views: {},
_id: 0 _id: 0
} }
}, new function() { // Injection scope for mouse handlers }, new function() {
// Injection scope for special code on browser (mouse events)
// and server (rendering)
/*#*/ if (options.browser) { /*#*/ if (options.browser) {
var tool, var tool,
timer, timer,
@ -579,9 +581,7 @@ var View = this.View = PaperScopeItem.extend(/** @lends View# */{
updateFocus: updateFocus updateFocus: updateFocus
} }
}; };
/*#*/ } // options.browser /*#*/ } else if (options.server) {
}, new function() {
/*#*/ if (options.server) {
var path = require('path'); var path = require('path');
// Utility function that converts a number to a string with // Utility function that converts a number to a string with
// x amount of padded 0 digits: // x amount of padded 0 digits: