Remove dummy concept in favor of editor group and editors
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import { debounce } from '@/utils';
|
||||
/* @ngInject */
|
||||
export function infiniteScroll() {
|
||||
return {
|
||||
link: function (scope: ng.IScope, elem: JQLite, attrs: any) {
|
||||
const scopeAny = scope as any;
|
||||
const offset = parseInt(attrs.threshold) || 0;
|
||||
const e = elem[0];
|
||||
const element = elem[0];
|
||||
scopeAny.paginate = debounce(() => {
|
||||
scope.$apply(attrs.infiniteScroll);
|
||||
}, 100);
|
||||
scopeAny.onScroll = () => {
|
||||
if (
|
||||
scope.$eval(attrs.canLoad) &&
|
||||
e.scrollTop + e.offsetHeight >= e.scrollHeight - offset
|
||||
element.scrollTop + element.offsetHeight >= element.scrollHeight - offset
|
||||
) {
|
||||
scope.$apply(attrs.infiniteScroll);
|
||||
scopeAny.paginate();
|
||||
}
|
||||
};
|
||||
elem.on('scroll', scopeAny.onScroll);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { WebDirective } from './../../types';
|
||||
import { isDesktopApplication, isNullOrUndefined } from '@/utils';
|
||||
import template from '%/directives/account-menu.pug';
|
||||
import { ProtectedAction, ContentType } from 'snjs';
|
||||
import { PureCtrl } from '@Controllers/abstract/pure_ctrl';
|
||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||
import {
|
||||
STRING_ACCOUNT_MENU_UNCHECK_MERGE,
|
||||
STRING_SIGN_OUT_CONFIRMATION,
|
||||
@@ -59,7 +59,7 @@ type AccountMenuState = {
|
||||
importData: any
|
||||
}
|
||||
|
||||
class AccountMenuCtrl extends PureCtrl {
|
||||
class AccountMenuCtrl extends PureViewCtrl {
|
||||
|
||||
public appVersion: string
|
||||
private syncStatus?: SyncOpStatus
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { WebDirective } from './../../types';
|
||||
import template from '%/directives/actions-menu.pug';
|
||||
import { PureCtrl } from '@Controllers/abstract/pure_ctrl';
|
||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||
import { SNItem, Action, SNActionsExtension } from '@/../../../../snjs/dist/@types';
|
||||
import { ActionResponse } from '@/../../../../snjs/dist/@types/services/actions_service';
|
||||
|
||||
@@ -10,7 +10,7 @@ type ActionsMenuScope = {
|
||||
item: SNItem
|
||||
}
|
||||
|
||||
class ActionsMenuCtrl extends PureCtrl implements ActionsMenuScope {
|
||||
class ActionsMenuCtrl extends PureViewCtrl implements ActionsMenuScope {
|
||||
|
||||
application!: WebApplication
|
||||
item!: SNItem
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WebDirective } from './../../types';
|
||||
import { WebApplication } from './../../application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import template from '%/directives/challenge-modal.pug';
|
||||
import {
|
||||
ChallengeType,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
Challenge,
|
||||
ChallengeOrchestrator
|
||||
} from 'snjs';
|
||||
import { PureCtrl } from '@Controllers/abstract/pure_ctrl';
|
||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||
|
||||
type InputValue = {
|
||||
value: string
|
||||
@@ -28,7 +28,7 @@ type ChallengeModalState = {
|
||||
processing: boolean
|
||||
}
|
||||
|
||||
class ChallengeModalCtrl extends PureCtrl implements ChallengeModalScope {
|
||||
class ChallengeModalCtrl extends PureViewCtrl implements ChallengeModalScope {
|
||||
private $element: JQLite
|
||||
private processingTypes: ChallengeType[] = []
|
||||
application!: WebApplication
|
||||
@@ -159,7 +159,8 @@ export class ChallengeModal extends WebDirective {
|
||||
this.template = template;
|
||||
this.controller = ChallengeModalCtrl;
|
||||
this.controllerAs = 'ctrl';
|
||||
this.bindToController = {
|
||||
this.bindToController = true;
|
||||
this.scope = {
|
||||
challenge: '=',
|
||||
orchestrator: '=',
|
||||
application: '='
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { WebApplication } from './../../application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { SNComponent } from 'snjs';
|
||||
import { WebDirective } from './../../types';
|
||||
import template from '%/directives/component-modal.pug';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { SNComponent } from 'snjs';
|
||||
import { WebDirective } from './../../types';
|
||||
import template from '%/directives/component-view.pug';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { WebDirective } from './../../types';
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { SNComponent, SNItem, ComponentArea } from 'snjs';
|
||||
import { isDesktopApplication } from '@/utils';
|
||||
import template from '%/directives/editor-menu.pug';
|
||||
import { PureCtrl } from '@Controllers/abstract/pure_ctrl';
|
||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||
import { ComponentMutator } from '@/../../../../snjs/dist/@types/models';
|
||||
|
||||
interface EditorMenuScope {
|
||||
@@ -13,7 +13,7 @@ interface EditorMenuScope {
|
||||
application: WebApplication
|
||||
}
|
||||
|
||||
class EditorMenuCtrl extends PureCtrl implements EditorMenuScope {
|
||||
class EditorMenuCtrl extends PureViewCtrl implements EditorMenuScope {
|
||||
|
||||
callback!: (component: SNComponent) => void
|
||||
selectedEditor!: SNComponent
|
||||
|
||||
@@ -84,7 +84,7 @@ class PanelResizerCtrl implements PanelResizerScope {
|
||||
this.$timeout = $timeout;
|
||||
|
||||
/** To allow for registering events */
|
||||
this.handleResize = this.handleResize.bind(this);
|
||||
this.handleResize = debounce(this.handleResize.bind(this), 250);
|
||||
this.onMouseMove = this.onMouseMove.bind(this);
|
||||
this.onMouseUp = this.onMouseUp.bind(this);
|
||||
this.onMouseDown = this.onMouseDown.bind(this);
|
||||
@@ -163,13 +163,11 @@ class PanelResizerCtrl implements PanelResizerScope {
|
||||
}
|
||||
|
||||
handleResize() {
|
||||
debounce(() => {
|
||||
this.reloadDefaultValues();
|
||||
this.handleWidthEvent();
|
||||
this.$timeout(() => {
|
||||
this.finishSettingWidth();
|
||||
});
|
||||
}, 250);
|
||||
this.reloadDefaultValues();
|
||||
this.handleWidthEvent();
|
||||
this.$timeout(() => {
|
||||
this.finishSettingWidth();
|
||||
});
|
||||
}
|
||||
|
||||
getParentRect() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { WebApplication } from './../../application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { PasswordWizardScope, PasswordWizardType, WebDirective } from './../../types';
|
||||
import template from '%/directives/password-wizard.pug';
|
||||
import { PureCtrl } from '@Controllers/abstract/pure_ctrl';
|
||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||
|
||||
const DEFAULT_CONTINUE_TITLE = "Continue";
|
||||
const Steps = {
|
||||
@@ -9,7 +9,7 @@ const Steps = {
|
||||
FinishStep: 2
|
||||
};
|
||||
|
||||
class PasswordWizardCtrl extends PureCtrl implements PasswordWizardScope {
|
||||
class PasswordWizardCtrl extends PureViewCtrl implements PasswordWizardScope {
|
||||
$element: JQLite
|
||||
application!: WebApplication
|
||||
type!: PasswordWizardType
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WebDirective } from './../../types';
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { ProtectedAction, PrivilegeCredential, PrivilegeSessionLength } from 'snjs';
|
||||
import template from '%/directives/privileges-auth-modal.pug';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { WebDirective } from './../../types';
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import template from '%/directives/privileges-management-modal.pug';
|
||||
import { PrivilegeCredential, ProtectedAction, SNPrivileges, PrivilegeSessionLength } from 'snjs';
|
||||
import { PureCtrl } from '@Controllers/abstract/pure_ctrl';
|
||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||
import { PrivilegeMutator } from '@/../../../../snjs/dist/@types/models';
|
||||
|
||||
type DisplayInfo = {
|
||||
@@ -10,7 +10,7 @@ type DisplayInfo = {
|
||||
prompt: string
|
||||
}
|
||||
|
||||
class PrivilegesManagementModalCtrl extends PureCtrl {
|
||||
class PrivilegesManagementModalCtrl extends PureViewCtrl {
|
||||
|
||||
hasPasscode = false
|
||||
hasAccount = false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { WebDirective } from './../../types';
|
||||
import {
|
||||
ContentType,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WebDirective } from './../../types';
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import template from '%/directives/session-history-menu.pug';
|
||||
import { SNItem, ItemHistoryEntry, ItemHistory } from '@/../../../../snjs/dist/@types';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { WebApplication } from '@/application';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { WebDirective } from './../../types';
|
||||
import template from '%/directives/sync-resolution-menu.pug';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user