mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-06 23:57:20 +02:00
Improve AngularJS module reference check in websiteFunctions.js
- Enhanced module check to first try window.app before falling back to angular.module - Ensures createWordpress controller can register properly - Fixes [$controller:ctrlreg] error for createWordpress controller - Applied to all websiteFunctions.js file locations
This commit is contained in:
@@ -5,7 +5,14 @@
|
||||
// Ensure app is available (get existing module or create reference)
|
||||
// This ensures compatibility with the global app variable from system-status.js
|
||||
if (typeof app === 'undefined') {
|
||||
app = angular.module('CyberCP');
|
||||
// First try to get window.app (set by system-status.js)
|
||||
if (typeof window !== 'undefined' && typeof window.app !== 'undefined') {
|
||||
app = window.app;
|
||||
} else {
|
||||
// If window.app doesn't exist, get the existing CyberCP module
|
||||
// This works because system-status.js should have already created it
|
||||
app = angular.module('CyberCP');
|
||||
}
|
||||
}
|
||||
|
||||
// Global function for deleting staging sites
|
||||
|
||||
Reference in New Issue
Block a user