Sha256: d10817c4cb44bc840f385392cc16213c14b1621fc3ea1717b7850e1ae5c134b4

Contents?: true

Size: 779 Bytes

Versions: 8

Compression:

Stored size: 779 Bytes

Contents

import axios from 'axios'
const railsAdmin = {
  namespaced: true,
  state: {
    inputId: ''
  },
  mutations: {
    SET_INPUT_ID (state, id) {
      state.inputId = id
    }
  },
  actions: {
    setInputId ({ commit}, id) {
      commit('SET_INPUT_ID', id)
    },
    insertImage ({commit, state, dispatch}, idImage) {
      dispatch('overlayStore/showProgressOverlay', true, {root:true})
      // Generating new dynamic image size before sending it back
      axios.get(`/images/${idImage}?width=0&height=0`).then((response) => {
        dispatch('overlayStore/showProgressOverlay', false, {root:true})
        window.opener.insertImageManagerMedia(idImage, state.inputId, response.data.src_for_wysiwyg)
        window.close()
      })
    }
  }
}

export default railsAdmin

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_admin_image_manager-0.1.26 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.25 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.24 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.23 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.22 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.21 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.20 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js
rails_admin_image_manager-0.1.15 app/assets/javascripts/rails_admin_image_manager/stores/railsAdmin.js