diff --git a/src/addon/calendar/pages/event/event.html b/src/addon/calendar/pages/event/event.html index f3f20e707..b55da9358 100644 --- a/src/addon/calendar/pages/event/event.html +++ b/src/addon/calendar/pages/event/event.html @@ -27,7 +27,7 @@

- {{event.moduleName}} + {{event.moduleName}}

diff --git a/src/addon/calendar/pages/list/list.html b/src/addon/calendar/pages/list/list.html index 7cdae7575..f61ed9e87 100644 --- a/src/addon/calendar/pages/list/list.html +++ b/src/addon/calendar/pages/list/list.html @@ -22,7 +22,7 @@ - +

{{ event.timestart | coreToLocaleString }}

diff --git a/src/app/app.scss b/src/app/app.scss index b12ba8d55..862c6232a 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -31,6 +31,9 @@ } } +.opacity-hide { opacity: 0; } +.core-big { font-size: 115%; } + @media only screen and (min-width: 430px) { .core-center-view .scroll-content { display: flex!important; @@ -63,6 +66,10 @@ margin: 0; } +.item-dimmed { + opacity: 0.6; +} + .core-oauth-icon, .item.core-oauth-icon, .list .item.core-oauth-icon { min-height: 32px; img, .label { @@ -82,6 +89,20 @@ font-weight: bold; } +.core-module-icon { + width: auto; +} + +.core-button-spinner { + min-height: 44px; + min-width: 50px; + text-align: center; + + .spinner { + margin-top: 8px; + } +} + // Avatar // ------------------------- // Large centered avatar @@ -133,7 +154,8 @@ ion-avatar ion-img, ion-avatar img { } /** Format Text */ -core-format-text[maxHeight], *[core-format-text][maxHeight] { +core-format-text[maxHeight], *[core-format-text][maxHeight], +core-format-text[ng-reflect-max-height], *[core-format-text][ng-reflect-max-height] { display: block; position: relative; width: 100%; @@ -148,6 +170,7 @@ core-format-text[maxHeight], *[core-format-text][maxHeight] { // This is to allow clicks in radio/checkbox content. &.core-text-formatted { cursor: pointer; + pointer-events: auto; .core-show-more { display: none; @@ -173,19 +196,6 @@ core-format-text[maxHeight], *[core-format-text][maxHeight] { z-index: 1001; background-color: $white; padding-left: 10px; - - /* @todo - &:after { - @extend .ion; - content: $ionicon-var-chevron-down; - margin-left: 10px; - color: $item-icon-accessory-color; - } - */ - } - - &.core-expand-in-fullview .core-show-more:after { - // content: $ionicon-var-chevron-right; @todo } &:before { @@ -205,6 +215,49 @@ core-format-text[maxHeight], *[core-format-text][maxHeight] { } } } + + &.core-expand-in-fullview { + .core-show-more { + @include svg-background-image($item-md-detail-push-svg, true); + @include padding-horizontal(null, 18px); + @include background-position(end, 0, center); + + background-repeat: no-repeat; + background-size: 14px 14px; + } + } +} + +.core-media-adapt-width { + max-width: 100%; +} + +audio.core-media-adapt-width { + width: 100%; +} + +.core-adapted-img-container { + position: relative; + display: inline-block; +} + +.core-image-viewer-icon { + position: absolute; + right: 10px; + bottom: 10px; + color: $black; + border-radius: 5px; + background: rgba(255, 255, 255, .5); + text-align: center; + + width: 32px; + height: 32px; + max-width: 32px; + line-height: 32px; + font-size: 24px; + ion-icon { + font-size: 24px; + } } core-format-text, *[core-format-text] { @@ -232,6 +285,15 @@ core-format-text, *[core-format-text] { width: initial; display: inline; } + + .core-disable-media-adapt, + .core-disable-media-adapt .core-media-adapt-width { + max-width: none !important; + max-height: none !important; + width: initial !important; + height: initial !important; + display: inline-block !important; + } } // Message item. @@ -273,3 +335,76 @@ ion-select { cursor: pointer; } } + +// Atto styles +// ------------------------- +.atto_image_preview { + width: 100%; + height: 100%; + margin-left: auto; + margin-right: auto; +} + +.atto_image_preview_box { + max-height: 200px; + margin-bottom: 1em; + overflow: auto; +} + +.editor_atto_content img { + cursor: pointer; +} + +.atto_image_size { + display: inline-block; +} + +.atto_image_size input[type=checkbox] { + margin-left: 1em; + margin-right: 1em; +} + +.atto_image_size input[type=text] { + width: 3em; +} + +.atto_image_size label { + display: inline-block; +} + +.atto_image_button_text-top { + vertical-align: text-top; + margin: 0 0.5em; +} + +.atto_image_button_middle { + vertical-align: middle; + margin: 0 0.5em; +} + +.atto_image_button_text-bottom { + vertical-align: text-bottom; + margin: 0 0.5em; +} + +.atto_image_button_text-top.img-responsive, +.atto_image_button_middle.img-responsive, +.atto_image_button_text-bottom.img-responsive { + /* If the image is display: block then linking the image to URLs won't work. */ + display: inline-block; + max-width: calc(100% - 1em); +} + +/*rtl:begin:ignore*/ +.atto_image_button_left { + float: left; + margin: 0 0.5em 0 0; + max-width: calc(100% - 1em); +} + +.atto_image_button_right { + float: right; + margin: 0 0 0 0.5em; + max-width: calc(100% - 1em); +} +/*rtl:end:ignore*/ \ No newline at end of file diff --git a/src/components/empty-box/empty-box.scss b/src/components/empty-box/empty-box.scss index 0b7562355..4147e73e7 100644 --- a/src/components/empty-box/empty-box.scss +++ b/src/components/empty-box/empty-box.scss @@ -27,6 +27,7 @@ core-empty-box { left: initial; right: initial; z-index: initial; + height: auto; } .icon { diff --git a/src/core/course/classes/module-prefetch-handler.ts b/src/core/course/classes/module-prefetch-handler.ts index ea263df1c..392296bff 100644 --- a/src/core/course/classes/module-prefetch-handler.ts +++ b/src/core/course/classes/module-prefetch-handler.ts @@ -86,7 +86,7 @@ export class CoreCourseModulePrefetchHandlerBase implements CoreCourseModulePref /** * List of download promises to prevent downloading the module twice at the same time. - * @type {Object} + * @type {{[s: string]: {[s: string]: Promise}}} */ protected downloadPromises: {[s: string]: {[s: string]: Promise}} = {}; @@ -260,9 +260,9 @@ export class CoreCourseModulePrefetchHandlerBase implements CoreCourseModulePref /** * Returns module intro files. * - * @param {Object} module The module object returned by WS. - * @param {Number} courseId Course ID. - * @return {Promise} Promise resolved with list of intro files. + * @param {any} module The module object returned by WS. + * @param {number} courseId Course ID. + * @return {Promise} Promise resolved with list of intro files. */ getIntroFiles(module: any, courseId: number) : Promise { return Promise.resolve(this.getIntroFilesFromInstance(module)); diff --git a/src/core/course/components/format/format.html b/src/core/course/components/format/format.html index cd368e00f..60289795a 100644 --- a/src/core/course/components/format/format.html +++ b/src/core/course/components/format/format.html @@ -2,7 +2,7 @@
- + @@ -52,7 +52,7 @@ - + diff --git a/src/core/course/components/module-completion/module-completion.html b/src/core/course/components/module-completion/module-completion.html index 78ef60782..7de6d78d5 100644 --- a/src/core/course/components/module-completion/module-completion.html +++ b/src/core/course/components/module-completion/module-completion.html @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/core/course/components/module-completion/module-completion.scss b/src/core/course/components/module-completion/module-completion.scss new file mode 100644 index 000000000..b0b4a663c --- /dev/null +++ b/src/core/course/components/module-completion/module-completion.scss @@ -0,0 +1,7 @@ +core-course-module-completion a { + img { + padding: 5px; + width: 30px; + vertical-align: middle; + } +} \ No newline at end of file diff --git a/src/core/course/components/module/module.html b/src/core/course/components/module/module.html index ab22d7525..90fc35bb4 100644 --- a/src/core/course/components/module/module.html +++ b/src/core/course/components/module/module.html @@ -1,13 +1,13 @@ - + - + -
+
- diff --git a/src/core/course/components/module/module.scss b/src/core/course/components/module/module.scss new file mode 100644 index 000000000..8eeee189e --- /dev/null +++ b/src/core/course/components/module/module.scss @@ -0,0 +1,30 @@ +core-course-module { + + a.core-course-module-handler { + align-items: flex-start; + item-inner { + padding-right: 0; + } + } + + .core-module-icon { + align-items: flex-start; + } + + .core-module-buttons { + display: flex; + flex-flow: row; + align-items: center; + z-index: 1; + cursor: pointer; + pointer-events: auto; + position: absolute; + right: 0; + top: 4px; + + .spinner { + right: 7px; + position: absolute; + } + } +} \ No newline at end of file diff --git a/src/core/course/pages/unsupported-module/unsupported-module.ts b/src/core/course/pages/unsupported-module/unsupported-module.ts index 0ed57eb2c..9d2be19fe 100644 --- a/src/core/course/pages/unsupported-module/unsupported-module.ts +++ b/src/core/course/pages/unsupported-module/unsupported-module.ts @@ -37,7 +37,6 @@ export class CoreCourseUnsupportedModulePage { * Expand the description. */ expandDescription() { - this.textUtils.expandText(this.translate.instant('core.description'), this.module.description, false, - undefined, undefined, this.navCtrl); + this.textUtils.expandText(this.translate.instant('core.description'), this.module.description); } } diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts index 961afbea8..1ba282c95 100644 --- a/src/core/course/providers/helper.ts +++ b/src/core/course/providers/helper.ts @@ -293,9 +293,9 @@ export class CoreCourseHelperProvider { /** * Confirm and prefetches a list of courses. * - * @param {Object[]} courses List of courses to download. - * @return {Promise} Promise resolved with true when downloaded, resolved with false if user cancels, rejected if error. - * It will send a "progress" everytime a course is downloaded or fails to download. + * @param {any[]} courses List of courses to download. + * @param {Function} [onProgress] Function to call everytime a course is downloaded. + * @return {Promise} Resolved with true when downloaded, resolved with false if user cancels, rejected if error. */ confirmAndPrefetchCourses(courses: any[], onProgress?: (data: CoreCourseCoursesProgress) => void) : Promise { const siteId = this.sitesProvider.getCurrentSiteId(); diff --git a/src/core/course/providers/module-prefetch-delegate.ts b/src/core/course/providers/module-prefetch-delegate.ts index f8506fad9..50b44fb64 100644 --- a/src/core/course/providers/module-prefetch-delegate.ts +++ b/src/core/course/providers/module-prefetch-delegate.ts @@ -1224,10 +1224,9 @@ export class CoreCourseModulePrefetchDelegate { /** * Update the enabled handlers for the current site. * - * @param {string} handles The module this handler handles, e.g. forum, label. - * @param {Object} handlerInfo The handler details. - * @param {Number} time Time this update process started. - * @return {Promise} Resolved when enabled, rejected when not. + * @param {CoreCourseModulePrefetchHandler} handler The handler to treat. + * @param {number} time Time this update process started. + * @return {Promise} Resolved when done. */ updateHandler(handler: CoreCourseModulePrefetchHandler, time: number) : Promise { let promise, diff --git a/src/core/courses/components/course-progress/course-progress.html b/src/core/courses/components/course-progress/course-progress.html index 45fca0e83..6eb3c2cd5 100644 --- a/src/core/courses/components/course-progress/course-progress.html +++ b/src/core/courses/components/course-progress/course-progress.html @@ -1,13 +1,18 @@ - -

- - - - -
+ + +

diff --git a/src/core/courses/components/course-progress/course-progress.scss b/src/core/courses/components/course-progress/course-progress.scss index 4587fe8ca..d115cdd3b 100644 --- a/src/core/courses/components/course-progress/course-progress.scss +++ b/src/core/courses/components/course-progress/course-progress.scss @@ -1,12 +1,34 @@ -core-courses-course-progress.core-courseoverview { - @media (max-width: 576px) { +core-courses-course-progress { + &.core-courseoverview { + @media (max-width: 576px) { + ion-card.card { + margin: 0; + border-radius: 0; + box-shadow: none; + border-bottom: 1px solid $list-border-color; + width: 100%; + height: 100% !important; + } + } + ion-card.card { - margin: 0; - border-radius: 0; - box-shadow: none; - border-bottom: 1px solid $list-border-color; - width: 100%; - height: 100% !important; + display: flex; + flex-direction: column; + justify-content: space-between; + } + } + + button { + z-index: 1; + } + + .core-course-link { + display: flex; + align-items: center; + justify-content: space-between; + + h2 { + flex-grow: 1; } } } diff --git a/src/core/courses/components/overview-events/overview-events.html b/src/core/courses/components/overview-events/overview-events.html index e39c479b2..75abaa680 100644 --- a/src/core/courses/components/overview-events/overview-events.html +++ b/src/core/courses/components/overview-events/overview-events.html @@ -1,7 +1,7 @@ - -

+ +

{{event.timesort * 1000 | coreFormatDate:"dfmediumdate" }}

- + {{prefetchCoursesData[courses.selected].badge}}
diff --git a/src/core/emulator/providers/capture-helper.ts b/src/core/emulator/providers/capture-helper.ts index 3d03605ba..d71a44690 100644 --- a/src/core/emulator/providers/capture-helper.ts +++ b/src/core/emulator/providers/capture-helper.ts @@ -44,11 +44,9 @@ export class CoreEmulatorCaptureHelperProvider { /** * Capture media (image, audio, video). * - * @param {String} type Type of media: image, audio, video. - * @param {Function} successCallback Function called when media taken. - * @param {Function} errorCallback Function called when error or cancel. - * @param {Object} [options] Optional options. - * @return {Void} + * @param {string} type Type of media: image, audio, video. + * @param {any} [options] Optional options. + * @return {Promise} Promise resolved when captured, rejected if error. */ captureMedia(type: string, options: any) : Promise { options = options || {}; diff --git a/src/core/login/pages/email-signup/email-signup.ts b/src/core/login/pages/email-signup/email-signup.ts index 5311a4a47..86bca81d8 100644 --- a/src/core/login/pages/email-signup/email-signup.ts +++ b/src/core/login/pages/email-signup/email-signup.ts @@ -263,6 +263,6 @@ export class CoreLoginEmailSignupPage { * Show authentication instructions. */ protected showAuthInstructions() { - this.textUtils.expandText(this.translate.instant('core.login.instructions'), this.authInstructions, true); + this.textUtils.expandText(this.translate.instant('core.login.instructions'), this.authInstructions); } } diff --git a/src/core/viewer/pages/image/image.html b/src/core/viewer/pages/image/image.html index 3783c5d38..d1eb33363 100644 --- a/src/core/viewer/pages/image/image.html +++ b/src/core/viewer/pages/image/image.html @@ -2,7 +2,7 @@ {{ title }} - + diff --git a/src/core/viewer/pages/image/image.ts b/src/core/viewer/pages/image/image.ts index 6253ddbba..97eab737e 100644 --- a/src/core/viewer/pages/image/image.ts +++ b/src/core/viewer/pages/image/image.ts @@ -27,14 +27,12 @@ import { IonicPage, ViewController, NavParams } from 'ionic-angular'; export class CoreViewerImagePage { title: string; // Page title. image: string; // Image URL. - isModal: boolean; // Whether it should be opened in a modal or in a page. component: string; // Component to use in external-content. componentId: string|number; // Component ID to use in external-content. constructor(private viewCtrl: ViewController, params: NavParams, translate: TranslateService) { this.title = params.get('title') || translate.instant('core.imageviewer'); this.image = params.get('image'); - this.isModal = params.get('isModal'); this.component = params.get('component'); this.componentId = params.get('componentId'); } diff --git a/src/core/viewer/pages/text/text.html b/src/core/viewer/pages/text/text.html index dfb15aacb..b00ee1f27 100644 --- a/src/core/viewer/pages/text/text.html +++ b/src/core/viewer/pages/text/text.html @@ -2,7 +2,7 @@ {{ title }} - + diff --git a/src/core/viewer/pages/text/text.ts b/src/core/viewer/pages/text/text.ts index dd0d6281d..e0647bf30 100644 --- a/src/core/viewer/pages/text/text.ts +++ b/src/core/viewer/pages/text/text.ts @@ -27,17 +27,14 @@ import { CoreTextUtilsProvider } from '../../../../providers/utils/text'; export class CoreViewerTextPage { title: string; // Page title. content: string; // Page content. - isModal: boolean; // Whether it should be opened in a modal or in a page. component: string; // Component to use in format-text. componentId: string|number; // Component ID to use in format-text. constructor(private viewCtrl: ViewController, params: NavParams, textUtils: CoreTextUtilsProvider) { this.title = params.get('title'); this.content = params.get('content'); - this.isModal = params.get('isModal'); this.component = params.get('component'); this.componentId = params.get('componentId'); - // @todo: Use replacelinebreaks param like in Ionic 1? format-text should do it by default. } /** diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index 289bfb23e..da089bc25 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -51,7 +51,6 @@ export class CoreFormatTextDirective implements OnChanges { // avoid this use class="inline" at the same time to use display: inline-block. @Input() fullOnClick?: boolean|string; // Whether it should open a new page with the full contents on click. Only if // "max-height" is set and the content has been collapsed. - @Input() brOnFull?: boolean|string; // Whether new lines should be replaced by
on full view. @Input() fullTitle?: string; // Title to use in full view. Defaults to "Description". @Output() afterRender?: EventEmitter; // Called when the data is rendered. @@ -148,7 +147,7 @@ export class CoreFormatTextDirective implements OnChanges { anchor.addEventListener('click', (e: Event) => { e.preventDefault(); e.stopPropagation(); - this.domUtils.viewImage(imgSrc, img.getAttribute('alt'), true, this.component, this.componentId); + this.domUtils.viewImage(imgSrc, img.getAttribute('alt'), this.component, this.componentId); }); container.appendChild(anchor); @@ -177,8 +176,10 @@ export class CoreFormatTextDirective implements OnChanges { this.text = this.text.trim(); this.formatContents().then((div: HTMLElement) => { - this.element.innerHTML = ''; // Remove current contents. + // Disable media adapt to correctly calculate the height. + this.element.classList.add('core-disable-media-adapt'); + this.element.innerHTML = ''; // Remove current contents. if (this.maxHeight && div.innerHTML != "") { // Move the children to the current element to be able to calculate the height. // @todo: Display the element? @@ -221,17 +222,15 @@ export class CoreFormatTextDirective implements OnChanges { } // Open a new state with the contents. - // @todo: brOnFull is needed? this.textUtils.expandText(this.fullTitle || this.translate.instant('core.description'), this.text, - false, this.component, this.componentId); + this.component, this.componentId); }); } } else { this.domUtils.moveChildren(div, this.element); } - this.element.classList.add('core-enabled-media-adapt'); - + this.element.classList.remove('core-disable-media-adapt'); this.finishRender(); }); } @@ -363,16 +362,7 @@ export class CoreFormatTextDirective implements OnChanges { * @return {number} The height of the element in pixels. When 0 is returned it means the element is not visible. */ protected getElementHeight(element: HTMLElement) : number { - let height; - - // Disable media adapt to correctly calculate the height. - element.classList.remove('core-enabled-media-adapt'); - - height = this.domUtils.getElementHeight(element); - - element.classList.add('core-enabled-media-adapt'); - - return height || 0; + return this.domUtils.getElementHeight(element) || 0; } /** diff --git a/src/providers/filepool.ts b/src/providers/filepool.ts index 78d87cfae..38f2ecb49 100644 --- a/src/providers/filepool.ts +++ b/src/providers/filepool.ts @@ -532,7 +532,7 @@ export class CoreFilepoolProvider { * * @param {string} siteId The site ID. * @param {string} fileId The file ID. - * @param {Object} data Additional information to store about the file (timemodified, url, ...). See mmFilepoolStore schema. + * @param {any} data Additional information to store about the file (timemodified, url, ...). See FILES_TABLE schema. * @return {Promise} Promise resolved on success. */ protected addFileToPool(siteId: string, fileId: string, data: any) : Promise { @@ -714,7 +714,7 @@ export class CoreFilepoolProvider { * @param {boolean} [checkSize=true] True if we shouldn't download files if their size is big, false otherwise. * @param {boolean} [downloadUnknown] True to download file in WiFi if their size is unknown, false otherwise. * Ignored if checkSize=false. - * @param {Object} [options] Extra options (isexternalfile, repositorytype). + * @param {any} [options] Extra options (isexternalfile, repositorytype). * @return {Promise} Promise resolved when the file is downloaded. */ protected addToQueueIfNeeded(siteId: string, fileUrl: string, component: string, componentId?: string|number, timemodified = 0, @@ -1571,7 +1571,7 @@ export class CoreFilepoolProvider { * @param {boolean} [checkSize=true] True if we shouldn't download files if their size is big, false otherwise. * @param {boolean} [downloadUnknown] True to download file in WiFi if their size is unknown, false otherwise. * Ignored if checkSize=false. - * @param {Object} [options] Extra options (isexternalfile, repositorytype). + * @param {any} [options] Extra options (isexternalfile, repositorytype). * @return {Promise} Resolved with the URL to use. * @description * This will return a URL pointing to the content of the requested URL. @@ -2003,7 +2003,7 @@ export class CoreFilepoolProvider { * @param {boolean} [checkSize=true] True if we shouldn't download files if their size is big, false otherwise. * @param {boolean} [downloadUnknown] True to download file in WiFi if their size is unknown, false otherwise. * Ignored if checkSize=false. - * @param {Object} [options] Extra options (isexternalfile, repositorytype). + * @param {any} [options] Extra options (isexternalfile, repositorytype). * @return {Promise} Resolved with the URL to use. * @description * This will return a URL pointing to the content of the requested URL. @@ -2045,7 +2045,7 @@ export class CoreFilepoolProvider { * @param {boolean} [checkSize=true] True if we shouldn't download files if their size is big, false otherwise. * @param {boolean} [downloadUnknown] True to download file in WiFi if their size is unknown, false otherwise. * Ignored if checkSize=false. - * @param {Object} [options] Extra options (isexternalfile, repositorytype). + * @param {any} [options] Extra options (isexternalfile, repositorytype). * @return {Promise} Resolved with the URL to use. * @description * This will return a URL pointing to the content of the requested URL. @@ -2608,7 +2608,7 @@ export class CoreFilepoolProvider { * Convenience function to check if a file should be downloaded before opening it. * * The default behaviour in the app is to download first and then open the local file in the following cases: - * - The file is small (less than mmFilepoolDownloadThreshold). + * - The file is small (less than DOWNLOAD_THRESHOLD). * - The file cannot be streamed. * If the file is big and can be streamed, the promise returned by this function will be rejected. */ diff --git a/src/providers/utils/dom.ts b/src/providers/utils/dom.ts index 3d91989fc..5e4df4f10 100644 --- a/src/providers/utils/dom.ts +++ b/src/providers/utils/dom.ts @@ -269,7 +269,7 @@ export class CoreDomUtilsProvider { * Returns height or width of an element. * * @param {any} element DOM element to measure. - * @param {boolean} [isWidth] Whether to get width or height. + * @param {boolean} [getWidth] Whether to get width or height. * @param {boolean} [usePadding] Whether to use padding to calculate the measure. * @param {boolean} [useMargin] Whether to use margin to calculate the measure. * @param {boolean} [useBorder] Whether to use borders to calculate the measure. @@ -852,13 +852,10 @@ export class CoreDomUtilsProvider { * * @param {string} image URL of the image. * @param {string} title Title of the page or modal. - * @param {boolean} [isModal] Whether it should be opened in a modal (true) or in a new page (false). * @param {string} [component] Component to link the image to if needed. * @param {string|number} [componentId] An ID to use in conjunction with the component. - * @param {NavController} [navCtrl] The NavController instance to use. */ - viewImage(image: string, title?: string, isModal?: boolean, component?: string, componentId?: string|number, - navCtrl?: NavController) : void { + viewImage(image: string, title?: string, component?: string, componentId?: string|number) : void { if (image) { let params: any = { title: title, @@ -867,16 +864,8 @@ export class CoreDomUtilsProvider { componentId: componentId }; - if (isModal) { - // Open a modal with the contents. - params.isModal = true; - - let modal = this.modalCtrl.create('CoreViewerImagePage', params); - modal.present(); - } else if (navCtrl) { - // Open a new page with the contents. - navCtrl.push('CoreViewerImagePage', params); - } + let modal = this.modalCtrl.create('CoreViewerImagePage', params); + modal.present(); } } diff --git a/src/providers/utils/text.ts b/src/providers/utils/text.ts index 6880abe56..60ce12502 100644 --- a/src/providers/utils/text.ts +++ b/src/providers/utils/text.ts @@ -248,13 +248,10 @@ export class CoreTextUtilsProvider { * * @param {string} title Title of the new state. * @param {string} text Content of the text to be expanded. - * @param {boolean} [isModal] Whether it should be opened in a modal (true) or in a new page (false). * @param {string} [component] Component to link the embedded files to. * @param {string|number} [componentId] An ID to use in conjunction with the component. - * @param {NavController} [navCtrl] The NavController instance to use. Required if isModal is false. */ - expandText(title: string, text: string, isModal?: boolean, component?: string, componentId?: string|number, - navCtrl?: NavController) : void { + expandText(title: string, text: string, component?: string, componentId?: string|number) : void { if (text.length > 0) { let params: any = { title: title, @@ -263,18 +260,12 @@ export class CoreTextUtilsProvider { componentId: componentId }; - if (isModal) { - // Open a modal with the contents. - params.isModal = true; + // Open a modal with the contents. + params.isModal = true; - let modal = this.modalCtrl.create('CoreViewerTextPage', params); - modal.present(); - } else if (navCtrl) { - // Open a new page with the contents. - navCtrl.push('CoreViewerTextPage', params); - } + let modal = this.modalCtrl.create('CoreViewerTextPage', params); + modal.present(); } - } /** diff --git a/src/providers/utils/utils.ts b/src/providers/utils/utils.ts index 0979a38d3..b96d29995 100644 --- a/src/providers/utils/utils.ts +++ b/src/providers/utils/utils.ts @@ -170,11 +170,11 @@ export class CoreUtilsProvider { * Blocks leaving a view. This function should be used in views that want to perform a certain action before * leaving (usually, ask the user if he wants to leave because some data isn't saved). * - * @param {Object} scope View's scope. + * @param {object} scope View's scope. * @param {Function} canLeaveFn Function called when the user wants to leave the view. Must return a promise * resolved if the view should be left, rejected if the user should stay in the view. - * @param {Object} [currentView] Current view. Defaults to $ionicHistory.currentView(). - * @return {Object} Object with: + * @param {object} [currentView] Current view. Defaults to $ionicHistory.currentView(). + * @return {object} Object with: * -back: Original back function. * -unblock: Function to unblock. It is called automatically when scope is destroyed. */